PROGRAMMING:Interval 2
Keven is now faced with an interval problem. He doesn't think it's very difficult, so he wants to test you.
The main idea of the title is as follows:
It is known that there is a sequence of length n with an initial value of 0, and K operations are performed on this sequence,
Each operation gives a number OP first,
If OP is 0, then two numbers L and R will be given later, which means to find the sum of the interval L-R and output it on one line.
If OP is 1, then three numbers L, R and val will be given later, which means that all the numbers in the interval L-R will be operated with val.
###Input format:
In the first line, the two numbers N and K (n < 200000, K < 100000) indicate the sequence length (sequence subscript starts from 1) and the number of operations.
The next line has n numbers A1, A2,..., an (an is less than 1000000), indicating the initial value of the sequence.
After K line, if OP is 0, then there are two numbers L and r( L<=N,R<=N)
If OP is 1, there are three numbers L, R and Val after it( L<=N,R<=N,val<1e8)
###Output format:
If OP is 0, the sum of intervals L-R is output in one line.
###Input example:
```in
5 3
1 2 3 4 5
0 1 4
1 2 5 10
0 1 4
```
###Output example:
```out
ten
thirty-six
```
###Tips:
In the first op = 0 operation, array A is [1,2,3,4,5], so [1,4] and are 10
In the second OP = 0 operation, array A is [1,10,11,14,15], so [1,4] and are 36 < br > < br > < br > < br > respectively
answer:If there is no answer, please comment
The main idea of the title is as follows:
It is known that there is a sequence of length n with an initial value of 0, and K operations are performed on this sequence,
Each operation gives a number OP first,
If OP is 0, then two numbers L and R will be given later, which means to find the sum of the interval L-R and output it on one line.
If OP is 1, then three numbers L, R and val will be given later, which means that all the numbers in the interval L-R will be operated with val.
###Input format:
In the first line, the two numbers N and K (n < 200000, K < 100000) indicate the sequence length (sequence subscript starts from 1) and the number of operations.
The next line has n numbers A1, A2,..., an (an is less than 1000000), indicating the initial value of the sequence.
After K line, if OP is 0, then there are two numbers L and r( L<=N,R<=N)
If OP is 1, there are three numbers L, R and Val after it( L<=N,R<=N,val<1e8)
###Output format:
If OP is 0, the sum of intervals L-R is output in one line.
###Input example:
```in
5 3
1 2 3 4 5
0 1 4
1 2 5 10
0 1 4
```
###Output example:
```out
ten
thirty-six
```
###Tips:
In the first op = 0 operation, array A is [1,2,3,4,5], so [1,4] and are 10
In the second OP = 0 operation, array A is [1,10,11,14,15], so [1,4] and are 36 < br > < br > < br > < br > respectively
answer:If there is no answer, please comment