PROGRAMMING:Finding the sum of intervals
This question will give you an integer sequence with length of $$n $, and ask for $$k $$. Each time you ask for the sum of the interval from $$a $$to $$B $$(sequence * * subscript from 1 to n * *). Since the interval sum is likely to be large, please output the result of * * moduling 10000019 * *.
(Note: if you can't think of an efficient method, you can use the simple algorithm to get part of the score, but the full score of this question requires you to use a more efficient method.)
###Input format:
First, a row of integers, $$n $, represents the length of the sequence.
The next line, $$n $$integers, is the sequence content.
The next line, the integer $$k $, represents the number of queries for the interval sum.
Next, there are two integers $$a $$and $$B $$in the $$k $$line. Please input the sum of elements (including) from $$a $$to $$B $$in the sequence and the result after module extraction.
###Output format:
A total of $$k $$lines, each line an integer, representing the interval of the query and the result after modulus.
###Input example:
Here is a set of inputs. For example:
```in
five
1 2 3 4 5
three
1 5
2 3
3 3
```
###Output example:
The corresponding output is given here. For example:
```out
fifteen
five
three
```
###Data restrictions:
$$N<=10^6$$
$$K<=10^5$$
answer:If there is no answer, please comment
(Note: if you can't think of an efficient method, you can use the simple algorithm to get part of the score, but the full score of this question requires you to use a more efficient method.)
###Input format:
First, a row of integers, $$n $, represents the length of the sequence.
The next line, $$n $$integers, is the sequence content.
The next line, the integer $$k $, represents the number of queries for the interval sum.
Next, there are two integers $$a $$and $$B $$in the $$k $$line. Please input the sum of elements (including) from $$a $$to $$B $$in the sequence and the result after module extraction.
###Output format:
A total of $$k $$lines, each line an integer, representing the interval of the query and the result after modulus.
###Input example:
Here is a set of inputs. For example:
```in
five
1 2 3 4 5
three
1 5
2 3
3 3
```
###Output example:
The corresponding output is given here. For example:
```out
fifteen
five
three
```
###Data restrictions:
$$N<=10^6$$
$$K<=10^5$$
answer:If there is no answer, please comment