#c22702. 差分练习

差分练习

Difference Array Practice

Problem Description

You are given a sequence a1,a2,…,ana_1, a_2, \dots, a_n.

You must support qq operations. Each operation gives an interval [l,r][l, r] and adds 11 to al,al+1,…,ara_l, a_{l+1}, \dots, a_r.

Find what the whole sequence becomes at the end.

Input Format

The first line contains two integers n,qn, q.

The next line contains nn integers a1,a2,…,ana_1, a_2, \dots, a_n.

The following qq lines each contain two integers l,rl, r.

Output Format

Output one line with nn 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 100%100\% of the data: 1≤n,q≤1051 \le n, q \leq 10^5, 1≤ai≤1051 \leq a_i \leq 10^5, 1≤l≤r≤n1 \le l \le r \le n.