Christmas Wreath

AtCoder
IDarc131_e
Time3000ms
Memory256MB
Difficulty
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. ![image](https://img.atcoder.jp/arc131/f18d2d54777d013bec4a137f048d4609.png) 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$ [samples]
Samples
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.

Yes
RBW
WB
R
API Response (JSON)
{
  "problem": {
    "name": "Christmas Wreath",
    "description": {
      "content": "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 the",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 3000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "arc131_e"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "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 the...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments