Statement
You are given non-negative integers .
Define a sequence of length as follows.
You may perform the following operation any number of times: choose two distinct indices and replace both and with .
Find the minimum number of operations required to make all elements of equal, and output one sequence of operations attaining the minimum. If it is impossible, print .
If it is possible, it can be proven that under the given constraints, the minimum number of operations is always at most .
Partial scoring is available for this problem. See the Scoring section for details.
Input
The input is given from Standard Input in the following format:
Output
If it is impossible, print on one line.
Otherwise, first print the minimum number of operations . Then print lines; on the -th line, print the two indices chosen in the -th operation, in the following format:
Constraints
- .
- .
Subtasks
Scoring
The score for each test case, as a percentage of the score of the subtask containing it, is calculated as follows.
If it is impossible to make all elements equal:
- If you print , the score is .
- Otherwise, the score is .
If it is possible to make all elements equal:
- If you print , the score is .