Please write a program that maintains a sequence, supporting the following operation:
|1. Get Sum||GET-SUM posi tot||Starting at the ~posi~-th number in the current sequence, output the sum of ~tot~ consecutive numbers.|
The first line of input contains two integers ~N~ and ~M~, where ~N~ is the initial length of the sequence and ~M~ is the number of operations.
The second line of input contains ~N~ integers, describing the initial sequence.
For the next ~M~ lines, each line will contain a command in one of the formats described above.
For each GET-SUM operation in the input, output the result of the query on a separate line.
9 5 2 -6 3 5 1 -5 -3 6 3 GET-SUM 5 4 GET-SUM 2 2 GET-SUM 5 3 GET-SUM 1 6 GET-SUM 8 1
-1 -3 -7 0 6
The data in the input is guaranteed to be valid, and will always refer to existing positions in the sequence.
In test data worth ~100\%~ of the points, ~N \le 1~ ~000~.
In test data worth ~100\%~ of the points, the value of any number in the sequence will be in the range ~[-10~ ~000, 10~ ~000]~.
In test data worth ~100\%~ of the points, ~M \le 1~ ~000~.