You are given an array of integers, and then a list of operations to carry out on it, in order. Each operation is one of two kinds: it either changes a single element, or asks for the sum of a stretch of consecutive elements.
Write a program that prints the answer to every question, using the array as it stands at that moment.
Input
First line of input will be a single integer - the number of testcases.
The first line of each testcase contains two integers and - the length of the array and the number of operations.
The second line contains integers .
Each of the next lines contains one operation, in one of two forms:
s i v- set the element at position to ;q l r- query the sum of the elements at positions .
Positions are counted from , so , and are all between and .
Output
For every q operation, in the order the operations appear, print on its own line the sum of that stretch.
Example
1 5 5 1 2 3 4 5 q 0 4 q 2 3 s 2 5 s 3 6 q 0 4
15 7 19
The array starts as , so the whole array sums to and positions to sum to . After the two changes the array is , which sums to .
Constraints
and
and
The sum of over all testcases does not exceed , and so does the sum of
This problem was adapted, with permission, from Sume segmenata promenljivog niza, authored by Društvo matematičara Srbije and Fondacija Petlja.