You are given a sequence whose first five terms are 3, 0, 1, 6, and 7. You have to process Q queries containing the following:
Write a program to find the sum of all the elements from the \(L^{th}\) position to the \(R^{th}\) position in the sequence.
Input format
Output format
For each query, print the sum of all elements from the \(L^{th}\) position to the \(R^{th}\) position in the sequence.
Constraints
\(1 ≤ Q ≤ 10^5\)
\(1 ≤ L ≤ R ≤ 10^5\)
For first query the answer is 4 as the first three terms are 3,0,1.
For third query the answer is 6 as 4th term is 6.