Problem list
Log in
#coci00249 · COCI 2012/2013 Contest 3

Sahovnica

Bronze II 1.0 s 32 MB

Mirko has become a hardcore patriot, so he has asked you to draw him a Croatian chessboard (checkerboard). The chessboard consists of red and white cells. The upper left cell is red, with the remaining cells alternating between white and red in rows as well as columns. We will represent red areas with ‘X’ (uppercase letter x) characters, and white areas with ‘.’ (period) characters. Mirko's chessboard should consist of $R \times C$ cells, that is, R rows and C columns. Each row should be A characters high, and each column B characters wide. Consider the sample tests below for further clarification.

Input

The first line of input contains two positive integers R and C ($1 \le R$, $C \le 10$) from the problem statement. The second line of input contains two positive integers A and B ($1 \le A$, $B \le 10$) from the problem statement.

Output

The output must consist of a total of $R * A$ rows and $C * B$ columns, forming the chessboard described above.

Example 1

Input
2 4
2 2
Output
XX..XX..
XX..XX..
..XX..XX
..XX..XX

Example 2

Input
5 5
2 3
Output
XXX...XXX...XXX
XXX...XXX...XXX
...XXX...XXX...
...XXX...XXX...
XXX...XXX...XXX
XXX...XXX...XXX
...XXX...XXX...
...XXX...XXX...
XXX...XXX...XXX
XXX...XXX...XXX
Source
COCI 2012/2013 Contest 3
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code