QOJ.ac

QOJ

時間限制: 3 s 記憶體限制: 256 MB 總分: 100 可 Hack ✓

#18703. Inverse ㄷㄷㄷㅈ

统计

Trong quá trình tạo dữ liệu cho bài toán D: ㄷㄷㄷㅈ, ban giám khảo UCPC nhận thấy rằng việc tạo ra một cây DUDUDUNGA với nhiều đỉnh là một việc khó khăn. Cho trước $N$, hãy viết chương trình xuất ra một cây DUDUDUNGA có $N$ đỉnh.

Dữ liệu vào

Dòng đầu tiên chứa số lượng đỉnh của cây $N$. ($6 \le N \le 300\,000$)

Dữ liệu ra

Xuất ra $N-1$ dòng, mỗi dòng chứa hai đầu mút của một cạnh, cách nhau bởi dấu cách. Số hiệu của các đỉnh phải là các số nguyên từ $1$ đến $N$.

Ví dụ

Dữ liệu vào 1

6

Dữ liệu ra 1

1 2
2 3
3 4
4 5
4 6

Ghi chú

Định nghĩa về cây DUDUDUNGA có thể tham khảo trong bài toán D: ㄷㄷㄷㅈ. Với mọi $N$ được cho trong dữ liệu vào, luôn tồn tại một cây DUDUDUNGA có đúng $N$ đỉnh.

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.