#P7510. 铃解缀
铃解缀
Description
Split the integers into ordered pairs (). You need to make sure that for every positive integer not greater than , we have .
Given , please provide one construction. If there is no solution, output -1 0.
Input Format
One line with one positive integer .
Output Format
If there is no solution, output one line with two integers -1 0. Otherwise output lines, each with two positive integers within , representing .
You need to ensure that the pairs , in order of increasing , together form a permutation of the integers .
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.
: .
: .
: is prime.
: no special restrictions.
For of the data, .
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
京公网安备 11011102002149号