#P7754. [COCI 2012/2013 #3] SAHOVNICA

[COCI 2012/2013 #3] SAHOVNICA

Description

A chessboard consists of red squares and white squares. The top-left square of the chessboard is red. The remaining squares alternate between white and red across the board. In this problem, we use X to represent a red area and . to represent a white area. Mirko's chessboard should consist of r×cr\times c squares, and each square is an a×ba\times b character matrix made up of the characters X and .. Please help him draw this chessboard.

Input Format

The input consists of two lines.

The first line contains two integers r,cr,c, representing the number of rows and columns of the chessboard, respectively.
The second line contains two integers a,ba,b, representing the number of rows and columns of the character matrix in each square, respectively.

Output Format

Output a total of r×ar\times a lines, each containing c×bc\times b characters, describing the final drawn chessboard.

2 4
2 2
XX..XX..
XX..XX..
..XX..XX
..XX..XX
5 5
2 3
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

Hint

【Constraints】

For all testdata, 1r,c,a,b101\leqslant r,c,a,b\leqslant 10.

【Source】

This problem is from COCI 2012-2013 CONTEST 3 T1 SAHOVNICA. Following the original testdata configuration, the full score is 50 points.

Translated and organized by Eason_AC.

Translated by ChatGPT 5