The Logging Company has been hit with a petition from concerned citizens regarding their uncontrolled tree-cutting. For public relations purposes, they have decided that, moving forward, they will only cut down trees with mass above a certain threshold.
The Logging Company has a line of
Input Specification
The first line will contain the integer
Output Specification
For each query, print the total mass of the trees at position
Sample Input
5
1 3 4 2 5
5
0 4 3
1 3 2
0 4 5
4 4 1
0 4 1
Sample Output
12
9
5
5
15
Comments
Is there somewhere you can find test cases for DMOPC problems?
You should learn how to come up with testcases on your own -- after all, most contests won't be nice enough to give you access to their test cases.
ok, thanks