You have $N$ integers, $A_1, A_2, … , A_N$. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the sum of numbers in a given interval.
Input
The first line contains two numbers $N$ and $Q$. $1 ≤ N,Q ≤ 100000$.
The second line contains $N$ numbers, the initial values of $A_1, A_2, … , A_N$. $-1000000000 \le A_i \le 1000000000$.
Each of the next $Q$ lines represents an operation.
“$C a b c$” means adding c to each of $A_a, A_{a+1}, … , A_b$. $-10000 \le c \le 10000$.
“$Q a b$” means querying the sum of $A_a, A_{a+1}, … , A_b$.
Output
You need to answer all $Q$ commands in order. One answer in a line.
ll a[maxn], sum[maxn], add[maxn]; // add[] 是增量标记 int L[maxn], R[maxn]; // 存放每个块的左右边界 int block[maxn]; // 存放下标为 i 的元素的块号 int n, q; int block_size; // 块的大小