#d2878. 简单差分

简单差分

Simple Difference Array

Problem Description

You are given an array AA of length nn. Perform the following operations mm times:

Select an interval [l,r][l, r] and add the integer xx to every number in that interval.

After all operations are done, answer kk queries:

Each query gives an interval [l,r][l, r] and asks for the sum of all numbers in that interval.

Input Format

The first line contains three positive integers n,m,kn, m, k.

The next line contains nn numbers, the array AA.

The next mm lines each contain three integers l,r,xl, r, x.

The next kk lines each contain two integers l,rl, r.

Output Format

Output kk lines, each containing one number — the sum for the corresponding query.

Sample Input

10 1 1
1 2 3 4 5 6 7 8 9 10
5 8 1
8 9

Sample Output

18

Constraints

For all data: 1≤n≤2×1051 \leq n \leq 2 \times 10^5, 1≤m,k≤1051 \leq m, k \leq 10^5, ∣x∣≤105|x| \leq 10^5.