atcoder#ARC086B. [ABC081D] Non-decreasing
[ABC081D] Non-decreasing
Score : points
Problem Statement
Snuke has an integer sequence, , of length . The -th element of (-indexed) is .
He can perform the following operation any number of times:
- Operation: Choose integers and between and (inclusive), and add to .
He would like to perform this operation between and times (inclusive) so that satisfies the condition below. Show one such sequence of operations. It can be proved that such a sequence of operations always exists under the constraints in this problem.
- Condition:
Constraints
- All input values are integers.
Input
Input is given from Standard Input in the following format:
Output
Let be the number of operations in your solution. In the first line, print . In the -th of the subsequent lines, print the numbers and chosen in the -th operation, with a space in between. The output will be considered correct if is between and (inclusive) and satisfies the condition after the operations.
3
-2 5 -1
2
2 3
3 3
- After the first operation, .
- After the second operation, , and the condition is now satisfied.
2
-1 -3
1
2 1
- After the first operation, and the condition is now satisfied.
5
0 0 0 0 0
0
- The condition is satisfied already in the beginning.