Range Sum Query
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The list contains integers. Find the sum of the numbers on the segment between indices and inclusive, i.e.,
Input
The first line contains the number of test cases . Each test starts with an empty line, followed by a line with two integers and . The next line contains non-negative integers, each no greater than . Then, lines follow, each containing two integers and .
Output
For each query, output the value of in a separate line. Separate the answers for different test cases with an empty line.
Examples
Input #1
Answer #1
Submissions 3K
Acceptance rate 35%