IntermediatePrefix Sums2000 ms256 MB
Workshop Capacity
Given attendance counts for sessions and a range `l` to `r`, print the total attendance in that inclusive range.
Statement
Given attendance counts for sessions and a range `l` to `r`, print the total attendance in that inclusive range.
Input
First line: `n`. Second line: `n` integers. Third line: `l r`.
Output
Print the range sum.
Constraints
- Positions are 1-indexed.
Examples
Example 1
Input
5
9 12 10 8 11
2 4Output
30Sessions 2 through 4 total 12 + 10 + 8.
Sample runs use visible examples. Full submissions are checked securely on the server, and private test cases are not shown in the browser.