Bingo

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Bingo is a game on a square grid. Each player gets an n×nn \times n grid and writes a unique number in each cell. The game host then draws a random number, and each player looks for that number on their grid and, if the number is present on their grid, fills in the corresponding cell. This repeats until someone finds nn filled cells on a single line, which we will call a bingo line.

There are 2n+22n + 2 possible bingo lines: nn horizontal lines, nn vertical lines, and 22 diagonal lines.

---  ...  ...  |..  .|.  ..|  \..  ../
...  ---  ...  |..  .|.  ..|  .\.  ./.
...  ...  ---  |..  .|.  ..|  ..\  /..

For example, the following grid has four bingo lines: two horizontal lines, one vertical line, and one diagonal line.

#..#.
#####
..###
#####
..###

Exactly when is a bingo line formed? That is completely random: you can get a line quite early if you are lucky, but on the other hand, you can fill most of the grid without getting any bingo lines. In this problem, we investigate the unfortunate case of filling kk cells without making any bingo lines.

Given two integers nn and kk, determine whether it is possible to fill exactly kk cells in an n×nn \times n grid, without making any bingo lines. If it's possible, demonstrate how to do it.

입력

The first and only line of input contains two integers, nn and kk.

출력

On the first line, output YES if it's possible to fill exactly kk cells of an n×nn \times n grid without making any bingo lines. Otherwise, output NO.

If the answer is YES, then output each row of the grid starting from the next line. Each row should be represented by a string of nn characters. The ii-th character is # (ASCII 35) if the ii-th cell of the row is filled, and . (ASCII 46) if it's not filled. Exactly kk cells must be filled, and there cannot be any bingo lines.

If there are multiple ways to fill the grid, then output any one of them.

제한

  • 1n1001 \leq n \leq 100
  • 0kn20 \leq k \leq n^2

힌트

Note that the second example is only valid for subtasks 2 and 3.