5 3 1 2 3 4 5 1 3 2 4 1 5
For this input, the required output is 6 9 15.
6 9 15
4 2 -1 2 -3 4 1 4 2 3
For this input, the required output is 2 -1.
2 -1
3 3 10 20 30 1 1 2 2 3 3
For this input, the required output is 10 20 30.
10 20 30
Given an array of nnn integers, answer qqq queries. Each query gives two indices lll and rrr, and asks for the sum of elements from index lll to rrr (inclusive).