#c22702. 差分练习
差分练习
Difference Array Practice
Problem Description
You are given a sequence .
You must support operations. Each operation gives an interval and adds to .
Find what the whole sequence becomes at the end.
Input Format
The first line contains two integers .
The next line contains integers .
The following lines each contain two integers .
Output Format
Output one line with integers, the answer.
Sample Input
5 3
1 2 3 4 5
1 3
2 4
3 5
Sample Output
2 4 6 6 6
Constraints
For of the data: , , .