| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 512 MB | 241 | 180 | 142 | 72.449% |
Inspired by the Ulam spiral, which unravels strange patterns of prime numbers' distribution, Petya decided to come up with his own analog.
Petya writes down integers from 1ドル$ to $n^2$ into square table of size $n\times n$ starting from the upper left corner. Numbers from 1ドル$ to $n$ go into the first row, numbers from $n + 1$ to 2ドルn$ --- into the second row, and so on.
Then he colors cells which contain the number with no more than $k$ different divisors. After that, Petya studies the resulting picture in hope of finding some patterns. For example, if $n = 7,ドル $k = 3,ドル Petya will get the following picture:
Help Petya, print the picture which he will get after coloring, representing colored cells with asterisks <<*>>, and non-colored cells with dots <<.>>.
Input contains two integers $n$ and $k$ (1ドル \le n \le 40,ドル 1ドル \le k \le n^2$).
Output $n$ lines, each one containing $n$ characters. If the $j$-th cell of $i$-th row of Petya's table is colored, then $j$-th character of $i$-th line should be equal to <<*>>, and <<.>> otherwise.
7 3
*****.* .*.*.*. ..*.*.. .*.*... *.*.... .*...*. *...*.*