You have an array of
Unfortunately, this is often impossible. So you will be allowed to cheat a little! At any point in time, you can choose an index
Constraints
You are allowed up to
Subtask 1 [30%]
Subtask 2 [70%]
Input Specification
The first line contains a single integer,
The next line contains
Output Specification
On the first line, output the number of operations used. This number must not exceed
On the remaining lines, print out your operations in order.
For the first operation, output 1 i
on a line, to indicate using the operation on index
For the second operation, output 2 i v
on a line, to indicate using the operation on index
Sample Input 1
6
3 4 4 2 5 1
Sample Output 1
4
2 1 4
2 4 4
2 5 4
2 6 4
Explanation for Sample 1
The array after each change is
4 4 4 2 5 1
4 4 4 4 5 1
4 4 4 4 4 1
4 4 4 4 4 4
The second operation is used only
Sample Input 2
6
3 4 4 2 5 1
Sample Output 2
5
1 3
1 5
1 4
1 2
1 6
Explanation for Sample 2
For the first operation,
3 4 3 2 5 1
For the next operation,
3 4 3 2 3 1
In the third operation,
3 4 3 3 3 1
And in the final two operations, the array becomes
3 3 3 3 3 1
3 3 3 3 3 3
Comments