Recently, Andrea received
- Change the number of candies in pile
$x$ to$v$ - Find the sum of the number of candies in the given interval
The first line contains two integers
The second line contains
The following
-
0 x v
: change the number of$a[x]$ to$v$ -
1 l r
: print the sum of the number of candies in the interval$[l,r]$ .
Print several lines. Each line contains one integer representing the result of operation 2.
5 4
3 6 1 8 5
1 2 5
0 3 4
1 1 4
1 2 5
20
21
23
For 30% testcases:
For all testcases: