You are given an array of length . You have to perform the following operation on the array times:
Print the final array after performing all the operations.
The input starts with the number of test cases — .
The first line of each test case contains and , indicating the number of elements in the array and the number of operations to be performed respectively.
The second line of each test case contains — elements of the array .
Then follows lines, each containing three values: — indicating an operation to be performed on the range using .
It is guaranteed that the summation of and does not exceed .
For each test case, print the case number (Case #:) followed by integers — indicating the array after performing all the operations. See the samples for more details.
Input | Output |
---|---|
2 5 3 2 3 0 9 4 1 3 2 4 5 1 4 4 3 2 2 10 15 1 2 5 1 1 2 | Case 1: 1 1 0 3 4 Case 2: 1 3 |