AtCoder Regular Contest 131
E
Christmas Wreath
AtCoder
⌀ 2314
原题
← DF →
翻译中…

Problem Statement

翻译中…

Takahashi has Christmas decoration consisting of $N$ balls and $\frac{N(N-1)}{2}$ ropes. The balls are numbered $1$ to $N$, and for any two different balls, there is exactly one rope that connects them.

翻译中…

翻译中…

He decides to light up each rope in red, blue, or white.

翻译中…

For better appearance, he wants to satisfy all of the following conditions.

翻译中…

Condition 1 the numbers of ropes lighted in red, blue, and white are all equal.

Condition 2 there is no triple of integers $a, b, c$ $(1 \leq a < b < c \leq N)$ such that all of the following three ropes have different colors:

  • the rope connecting $a$ and $b$,
  • the rope connecting $b$ and $c$,
  • the rope connecting $a$ and $c$.
翻译中…

Create a way to light up the ropes to satisfy the conditions. If there is no such way, report so.

翻译中…

Constraints

翻译中…
  • $3 \leq N \leq 50$
  • $N$ is an integer.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N

翻译中…

Output

翻译中…

If there is no way to light up the ropes to satisfy the conditions, print No.

翻译中…

If such a way exists, print it in the following format:

翻译中…

Yes
c_{1,2}c_{1,3}c_{1,4}\ldotsc_{1,N}
c_{2,3}c_{2,4}\ldotsc_{2,N}
 :
c_{N-1,N}

翻译中…

Here, the character $c_{i, j}$ $(1 \leq i < j \leq N)$ should be the following:

翻译中…
  • $c_{i, j} =$ R when lighting up the rope connecting Balls $i$ and $j$ red,
  • $c_{i, j} =$ B when lighting up the rope connecting Balls $i$ and $j$ blue,
  • $c_{i, j} =$ W when lighting up the rope connecting Balls $i$ and $j$ white.
翻译中…

样例

Input #1
4
Output #1
No
For $N=4$, there is no way to light up the ropes to satisfy the conditions, so the output `No` is correct. Below is an example of an output in the `Yes` case, **which is incorrect in this case.** This is because, for $(a, b, c) = (1, 2, 3)$ in **Condition 2**, the rope connecting $a, b$ is red, the rope connecting $b, c$ is white, and the rope connecting $a, c$ is blue, all of which have different colors.
题目信息
题号
arc131_e
时间限制
3 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。