AtCoder Grand Contest 032
B
Balanced Neighbors
AtCoder
⌀ 1259
原题
← AC →
翻译中…

Problem Statement

翻译中…

You are given an integer $N$. Build an undirected graph with $N$ vertices with indices $1$ to $N$ that satisfies the following two conditions:

翻译中…
  • The graph is simple and connected.
  • There exists an integer $S$ such that, for every vertex, the sum of the indices of the vertices adjacent to that vertex is $S$.
翻译中…

It can be proved that at least one such graph exists under the constraints of this problem.

翻译中…

Constraints

翻译中…
  • All values in input are integers.
  • $3 \leq N \leq 100$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N

翻译中…

Output

翻译中…

In the first line, print the number of edges, $M$, in the graph you made. In the $i$-th of the following $M$ lines, print two integers $a_i$ and $b_i$, representing the endpoints of the $i$-th edge.

翻译中…

The output will be judged correct if the graph satisfies the conditions.

翻译中…

样例

Input #1
3
Output #1
2
1 3
2 3
- For every vertex, the sum of the indices of the vertices adjacent to that vertex is $3$.
题目信息
题号
agc032_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。