Given an array
- Find the sum of all elements from index
to index . - Update the element at index
to value .
Constraints
Input Specification
The first line contains
The second line contains
The next
S l r
representing the first operation.U i x
representing the second operation.
Output Specification
For each type
Sample Input
Copy
5 5
1 2 3 4 5
S 2 4
S 1 5
U 2 6
S 2 2
S 2 4
Sample Output
Copy
9
15
6
13
Comments