Skolem XOR Tree

AtCoder
IDagc035_c
Time2000ms
Memory256MB
Difficulty
You are given an integer $N$. Determine if there exists a tree with $2N$ vertices numbered $1$ to $2N$ satisfying the following condition, and show one such tree if the answer is yes. * Assume that, for each integer $i$ between $1$ and $N$ (inclusive), Vertex $i$ and $N+i$ have the weight $i$. Then, for each integer $i$ between $1$ and $N$, the bitwise XOR of the weights of the vertices on the path between Vertex $i$ and $N+i$ (including themselves) is $i$. ## Constraints * $N$ is an integer. * $1 \leq N \leq 10^{5}$ ## Input Input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
3
Output #1
Yes
1 2
2 3
3 4
4 5
5 6

*   The sample output represents the following graph:
    
    ![image](https://img.atcoder.jp/agc035/d004b05438497d50637b534e89f7a511.png)
Input #2
1
Output #2
No

*   There is no tree satisfying the condition.
API Response (JSON)
{
  "problem": {
    "name": "Skolem XOR Tree",
    "description": {
      "content": "You are given an integer $N$. Determine if there exists a tree with $2N$ vertices numbered $1$ to $2N$ satisfying the following condition, and show one such tree if the answer is yes. *   Assume that",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "agc035_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given an integer $N$. Determine if there exists a tree with $2N$ vertices numbered $1$ to $2N$ satisfying the following condition, and show one such tree if the answer is yes.\n\n*   Assume that...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments