Problem Description

Read n numbers and q queries l r (0-based inclusive). For each query output sum. If query is out of range or invalid, output ERROR for that query.

Input Format

First line n q. Second line n ints. Next q lines l r.

Output Format

q lines sums or ERROR.

Sample Test Case

Input:
5 3 1 2 3 4 5 0 2 2 10 x 1
Output:
6 ERROR ERROR

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next