An Array and Partial Sums
A prefix sum array of an integer array of length is an array of length such that .
A suffix sum array of an integer array of length is an array of length such that .
We call the normalization of an integer array of length performing the assignment for .
An integer array of length is given.
We are allowed to perform operations of three types:
replace each element of array with its opposite (perform the assignment for );
select any subsegment of the array and replace it with the array of its prefix sums, then normalize array ;
select any subsegment of the array and replace it with the array of its suffix sums, then normalize array .
Find the shortest sequence of operations required to make all elements of array non-negative.
Note that for some blocks of tests, it is allowed to find a sequence of operations that is not the shortest possible.
Input
The first line contains two integers and (, ) — the length of the array and the test group number, respectively.
The second line contains integers () — the elements of the array.
Output
In the first line, print a single integer — the minimum number of operations required to make all elements of the array non-negative.
In the next lines, output the descriptions of the operations. Output the descriptions of operations of the first type in the format "1
". Output the descriptions of operations of the second and third types in the formats "2 l r
" and "3 l r
", respectively, where and () denote the left and right boundaries of the subarray of the corresponding operation.
If there are multiple correct answers, any of them may be printed.
Examples
Note
In the first example, the array changes twice:
after performing the third type of operation with parameters , , the array becomes equal to ;
after performing the second type of operation with parameters , , the array becomes equal to .
Scoring
Let the minimum number of operations required to make all elements of the array non-negative for a certain test be , and your solution uses operations.
( points): ;
( points): your solution will be considered correct if . It can be proved that there always exists a sequence of no more than operations under the given constraints;
( points): your solution will be considered correct if ;
( points): your solution will be considered correct if ;
( points): ; it is guaranteed that all shortest sequences of operations contain only operations of the second type;
( points): it is guaranteed that all shortest sequences of operations contain only operations of the second type;
( points): ;
( point): no additional constraints.