atcoder#AGC032B. [AGC032B] Balanced Neighbors
[AGC032B] Balanced Neighbors
Score : points
Problem Statement
You are given an integer . Build an undirected graph with vertices with indices to that satisfies the following two conditions:
- The graph is simple and connected.
- There exists an integer such that, for every vertex, the sum of the indices of the vertices adjacent to that vertex is .
It can be proved that at least one such graph exists under the constraints of this problem.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
In the first line, print the number of edges, , in the graph you made. In the -th of the following lines, print two integers and , representing the endpoints of the -th edge.
The output will be judged correct if the graph satisfies the conditions.
3
2
1 3
2 3
- For every vertex, the sum of the indices of the vertices adjacent to that vertex is .