| Abakoda Long Contest 2022 |
|---|
| Закончено |
Bob's Mondrianansala artworks from last year were so popular that his art teacher has tasked him with creating another collection of paintings for this year's STEM Exhibit. Bob, foolishly, accepts.
Bob's paintings will once again be composed entirely of rectangles, in what he calls the Mondriamorsolo style. This year, Bob wants his paintings to be even more gorgeously geometric, so he recalls the following definitions from math class.
Recall that two objects are congruent if one can be transformed into the other by some combination of rotations or reflections. Two objects are similar if one can be made congruent to the other by scaling it up or down by the same amount in all directions.
For example, consider the following image.
Bob wants all rectangles in his painting to be irreducible, which he defines as follows:
Now, the problem. A painting is in the Mondriamorsolo style if it satisfies all of the following criteria.
Given a positive integer $$$n$$$, help Bob by producing any painting of that size in the Mondriamorsolo style, or say that no such painting exists.
Input consists of a single line that contains a single integer $$$n$$$.
$$$$$$\begin{align*}
&\begin{array}{|l|} \hline \text{Constraints For All Subtasks} \\ \hline 1 \leq n \leq 1200 \\ \hline \end{array}\\
&\begin{array}{|c|c|l|} \hline \text{Subtask} & \text{Points} & \text{Constraints} \\ \hline 1 & \mathbf{30} & 1 \leq n \leq 8 \\ \hline 2 & \mathbf{16} & \text{$n=1$ or $n = 1000$} \\ \hline 3 & \mathbf{16} & \text{$n=1$ or $n = 1011$} \\ \hline 4 & \mathbf{16} & \text{$n=1$ or $n = 1200$} \\ \hline 5 & \mathbf{11} & 1 \leq n \leq 100 \\ \hline 6 & \mathbf{11} & \text{No further constraints.} \\ \hline \end{array}\\
\end{align*}$$$$$$
If the task is possible, output YES. Otherwise, output NO.
If YES, also output the painting. We will treat the painting as a pixelmap and represent it as an ASCII grid.
Output $$$n$$$ lines, each containing a string with $$$n$$$ uppercase English letters, representing the painting. Two pixels are considered the same color if they are represented by the same letter. Contiguous regions of pixels of the same color correspond to the rectangles.
1
YES A
2
NO
7
YES CAABBBC BAABBBC BAABBBC BAABBBC BAABBBC BAACCCB BAACCCB
| Название |
|---|


