You are given a series of numbers. You are to process some queries to get the sum of all numbers in the series from 1 to and including .
Subtask 1
For 3 of the 5 available points, .
Input Specification
The first line contains representing how many numbers are in the series.
The next line contains space separated integers representing the numbers in the series in order.
The next line contains representing how many queries you are required to process.
The last line contains space separated integers, representing the ending index of the range you must get the sum of where the first number is at index 1.
Output Specification
For each query, output on a new line the sum of all numbers in the series from index 1 (the first number) to and including index .
Sample Input
3
3 2 7
2
1 3
Sample Output
3
12
Comments