atcoder#AGC058A. [AGC058A] Make it Zigzag
[AGC058A] Make it Zigzag
Score : points
Problem Statement
You are given a permutation of .
The following operation may be performed between and times (inclusive).
- Choose an integer (). Swap the values of and .
Present a sequence of operations that make satisfy the following conditions.
- i=1,3,5,\cdots,2N-1$;
- for each .
It can be proved that such a sequence of operations always exists.
Constraints
- is a permutation of .
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print a desired sequence of operations in the following format:
Here, is the number of operations performed (), and is the value of chosen in the -th operation (). If there are multiple solutions satisfying the condition, printing any of them will be accepted.
2
4 3 2 1
2
1 3
These operations make , which satisfies the conditions.
1
1 2
0