QOJ.ac

QOJ

Time Limit: 3 s Memory Limit: 256 MB Total points: 100 Hackable ✓

#18703. 反轉 ㄷㄷㄷㅈ

Statistics

UCPC 出題團隊在製作 D 題:ㄷㄷㄷㅈ 的測資時,發現要建立一個擁有許多頂點的 DUDUDUNGA-樹(DUDUDUNGA-tree)相當困難。給定 $N$,請寫一個程式來輸出一個擁有 $N$ 個頂點的 DUDUDUNGA-樹。

輸入格式

第一行給定樹的頂點數量 $N$。($6 \le N \le 300\,000$)

輸出格式

輸出 $N-1$ 行,每行包含兩個以空白分隔的整數,代表邊的兩個端點。頂點編號必須為 $1$ 到 $N$ 之間的整數。

範例

範例輸入 1

6

範例輸出 1

1 2
2 3
3 4
4 5
4 6

說明

DUDUDUNGA-樹的定義請參考 D 題:ㄷㄷㄷㅈ。對於輸入的 $N$,保證一定存在一個擁有 $N$ 個頂點的 DUDUDUNGA-樹。

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.