You are given an integer sequence a = (a_1, a_2, \ldots, a_n) of length .
There are queries, and for each query you need to find the answer. In the -th query, two integers l_i and r_i are given, and you must compute the value:
The first line contains two integers and q~(1 \le n, q \le 3 \times 10^5).
The second line contains integers a_1, a_2, \ldots, a_n~(1 \le a_i \le 100).
Then follow lines, each containing two integers l_i, r_i~(1 \le l_i \le r_i \le n).
Print lines. In the -th line, output a single integer — the answer to the -th query.
Example 1