You are given an array of length . There are updates of the form l r v
, which means to add to all elements in the subarray .
You would like to know the array after these updates.
Input Specification
The first line will contain two integers, .
The second line will contain integers, , the initial array.
The next lines will each contain an update of the form described above. It is guaranteed and .
Output Specification
Output the array after these updates on a single line.
Subtasks
Subtask [20%]
Subtask [80%]
No further constraints.
Sample Input
5 4
1 2 3 0 2
1 3 2
1 5 1
3 4 10
2 2 1
Sample Output
4 6 16 11 3
Comments