Logo
(追記) (追記ここまで)

19741번 - Patterns 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB24118014272.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.

제한

예제 입력 1

7 3

예제 출력 1

*****.*
.*.*.*.
..*.*..
.*.*...
*.*....
.*...*.
*...*.*

힌트

출처

Olympiad > Russian Olympiad in Informatics > Russia High School Programming Contest > Russia High School Programming Contest 2017 A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /