#P7510. 铃解缀

铃解缀

Description

Split the integers 12n1 \sim 2n into nn ordered pairs (ai,bi)(a_i, b_i) (1in1 \le i \le n). You need to make sure that for every positive integer ii not greater than nn, we have aibi=ia_i - b_i = i.

Given nn, please provide one construction. If there is no solution, output -1 0.

Input Format

One line with one positive integer nn.

Output Format

If there is no solution, output one line with two integers -1 0. Otherwise output nn lines, each with two positive integers within 12n1 \sim 2n, representing (ai,bi)(a_i, b_i).

You need to ensure that the nn pairs (ai,bi)(a_i, b_i), in order of increasing aibia_i - b_i, together form a permutation of the integers 12n1 \sim 2n.

2

-1 0

5

2 1
9 7
6 3
8 4
10 5

Hint

Sample Explanation

For the first sample, obviously there is no solution.

For the second sample, the sample output gives a feasible construction.

Constraints and Notes

This problem uses bundled tests.

Subtask 1 (20 pts)\texttt{Subtask 1 (20 pts)}: n5n \le 5.

Subtask 2 (20 pts)\texttt{Subtask 2 (20 pts)}: n105n \le 10 ^ 5.

Subtask 3 (30 pts)\texttt{Subtask 3 (30 pts)}: nn is prime.

Subtask 4 (30 pts)\texttt{Subtask 4 (30 pts)}: no special restrictions.

For 100%100\% of the data, 1n1061 \le n \le 10^6.

This problem is meant to train mathematical thinking and construction skills, but it is not suitable for OI contests.

CoOI Round 1 Problem B.

Translated by ChatGPT 5