4967. A number game

单点时限: 2.0 sec

内存限制: 256 MB

Foxity and Foxitu are good friends. They like to play number games. One day, Foxity played ICPC with his teammates, leaving Foxitu alone at labs. So he played a number game with himself.

There are $n$ numbers from $1$ to $n$ in a set, each time he can choose two distinct number $a$ and $b$($a \ne b$). He firstly remove $ a $ and $ b $ from this set, then insert $a+b$ and $ \lvert a-b \rvert $ to the set. His goal is to leave the set with only two elements, and He can only operate on this set at most $ n $ times.

Please provide any of his possible operation sequence.

There will be no identical elements in the set, and identical elements are treated as one element.

输入格式

One line contains one integer $ n(2 \le n \le 10^5) $ ,which is the size of the set.

输出格式

The first line contains an integer $m$, which is the number of operations.
Follow $m$ lines with two integer $a$ and $b$, which represents each operation.

样例

Input
10
Output
5
4 5
1 9
3 7
2 8
4 6
Input
6
Output
3
1 6
2 5
3 4

提示

We guarantee that the first $9$ test data satisfying that $n$ is less than $11$.

16 人解决,31 人已尝试。

17 份提交通过,共有 80 份提交。

6.2 EMB 奖励。

创建: 1 年,5 月前.

修改: 1 年,5 月前.

最后提交: 10 月前.

来源: N/A

题目标签