409. Berland Flag
Time limit per test: 0.25
Memory limit: 65536
The Berland is in trouble again. After the recent elections All-Berland Great Duma has divided into two coalitions:
Blue-eyed coalition and Red-eyed coalition. On the independence day the following question was raised: what will the national
flag look like?
Both coalitions agreed that the flag should be a square of N2
cells, each of
them painted blue of red. To make the flag acceptable for both coalitions, the following
requirements must be held:
every row of the flag must contain exactly K blue cells
every column of the flag must contain exactly K blue cells
if we split the flag into squares of N x N cells (there will be N x N such squares), then
every such square must contain exactly K blue cells.
You are the chief programmers in Berland. So, making the flag model is your duty.
InputFirst line of the input contains two integer numbers N and K (1 ≤ N ≤ 20, 0 ≤ K ≤ N2).
OutputOutput description of the desired flag.
Print N2 lines which consist of N2 characters
'*' means blue cell and
'.' means red cell.
"NO SOLUTION" (without quotes), if there is no flag which satisfies both coalitions.
If there are several solutions, output any of them.