#ds501. 等差数列加
等差数列加
Arithmetic Progression Addition
Problem Description
You are given a sequence which is initially all .
You need to support operations:
1 x y d: add to every position with .2 x: point query the value of .
Input Format
The first line contains two integers ().
The next lines each describe an operation, with guaranteed.
Output Format
For each query operation, output one number, the answer.
Sample Input
5 6
1 2 1 3
1 3 2 5
2 3
2 5
1 5 0 6
2 5
Sample Output
3
8
14