Range Sum Query
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given a list containing integers, find the Range Sum Query (RSQ) between index and , inclusive, i.e.
Input
The first line contains the number of test cases . Each test case starts with a blank line, followed by a line that contains two integers and . Then, the next line contains non-negative integers up to . Then lines follow. Each line contains two integers and .
Output
For each query, print a line containing the value of . Separate two test cases with a blank line.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 35%