QOJ.ac

QOJ

実行時間制限: 3 s メモリ制限: 256 MB 満点: 100 ハック可能 ✓

#18703. Inverse ㄷㄷㄷㅈ

統計

While creating data for problem D: ㄷㄷㄷㅈ, the UCPC problem setters realized that it is difficult to construct a DUDUDUNGA-tree with many vertices. Given $N$, let's write a program that outputs a DUDUDUNGA-tree with $N$ vertices.

Input

The first line contains the number of vertices $N$ of the tree. ($6 \le N \le 300\,000$)

Output

Output $N-1$ lines, each containing the two endpoints of an edge, separated by a space. The vertex numbers must be integers between $1$ and $N$.

Examples

Input 1

6

Output 1

1 2
2 3
3 4
4 5
4 6

Note

Refer to problem D: ㄷㄷㄷㅈ for the definition of a DUDUDUNGA-tree. For any given $N$, a DUDUDUNGA-tree with $N$ vertices always exists.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.