[Solution] Madoka and Underground Competitions Codeforces Solution
Madoka decided to participate in an underground sports programming competition. And there was exactly one task in it:
A square table of size , where is a multiple of , is called good if only the characters '.' and 'X' are written in it, as well as in any subtable of size or , there is at least one character 'X'. In other words, among any consecutive vertical or horizontal cells, there must be at least one containing the character 'X'.
Output any good table that has the minimum possible number of characters 'X', and also the symbol 'X' is written in the cell . Rows are numbered from to from top to bottom, columns are
numbered from to from left to right.
The input consists of multiple test cases. The first line contains a single integer () — the number of test cases. Description of the test cases follows.
The first and the only line of each test case contains four integers , , , () — the size of the table, the integer and the coordinates of the cell, which must contain the character 'X'. It is guaranteed that is a multiple of .
It is guaranteed that the sum of over all test cases does not exceed .
For each test case, output lines, each consisting of characters '.' and 'X', — the desired table. If there are several answers, then you can output anyone.
No comments:
Post a Comment