409986: GYM103886 M Cereal Grids II

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

M. Cereal Grids IItime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Allen has bought some coveted alphabet cereal!

He has $$$n^2$$$ ($$$1 \leq{n^2} \leq{10^6}$$$) total pieces of cereal.

Curiously, the cereal pieces are only in the shape of the letters w, and u. Specifically, he has $$$m$$$ ($$$1 \leq{m} \leq{n^2}$$$) pieces marked w and $$$n^2 - m$$$ pieces marked u.

Of course, he wants to play around with them, and decides to place these cereal pieces into an $$$n$$$ by $$$n$$$ grid of cells. Each piece of cereal must go onto exactly one cell such that the entire grid is filled.

Allen notices that the grid contains some unusual phrases. He is most interested in forming his favorite phrase, uwu. He wants to know the optimal configuration of cereal pieces he can have such that the maximum number of uwu's can be seen on the grid (only horizontally or vertically).

Please help him figure this out!

Input

For each test case, there will be one line of input containing two space separated integers $$$n$$$ and $$$m$$$.

Output

Please output any grid configuration of $$$n^2$$$ cells if exactly $$$m$$$ of them have to be w, and the rest have to be u, such that there are the maximum possible number of uwu's in the grid.

Any grid configuration that satisfies the constraints and has the maximum uwu's will be considered correct.

Note that an uwu is in the grid if there are three consecutive characters (either horizontally or vertical) that spell out uwu.

ExamplesInput
3 5
Output
uwu
www
uwu
Input
3 2
Output
uwu
uwu
uuu
Note

In the first sample, there are 4 total uwu's in the grid: one on row 1, one on row 3, on on column 1, and one on column 3.

It can be proved that there can be a maximum of 4 uwu's in the grid given the constraints.

Problem Credits: Eric Hsu and Larry Xing

加入题单

算法标签: