#C5434. Construct a Shallow Tree
Construct a Shallow Tree
Construct a Shallow Tree
You are given an integer \(N\) representing the number of nodes in a tree. The nodes are labeled from \(1\) to \(N\). Your task is to construct a tree with the following properties:
- The tree is rooted at node \(1\).
- Every other node is directly connected to the root. Thus, the depth of every node is at most \(2\).
This means the tree will have exactly \(N-1\) edges (if \(N \ge 2\)). If \(N=1\), output nothing.
inputFormat
The input consists of a single integer (N) ((1 \le N \le 10^5)), which represents the number of nodes in the tree.
outputFormat
Output the list of edges of the tree. Each edge should be printed on a separate line as two space-separated integers (a) and (b), representing an edge from node (a) to node (b).## sample
5
1 2
1 3
1 4
1 5
</p>