Problem Description

Answer q range-sum queries on an array.

Input Format

Line1 n q. Line2 n ints. Next q lines l r (0-based).

Output Format

q lines sums.

Sample Test Case

Input:
5 3 1 2 3 4 5 0 2 1 3 2 4
Output:
6 9 12

Constraints

n,q

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next