#t327. 求部分区间和

求部分区间和

Partial Interval Sum

Problem Background

Special for beginners, ^_^

Problem Description

Given a sequence of nn integers, compute the sum of the numbers in the range [a,b][a, b].

$$\nsum(a, b) =\n\begin{cases}\nnum[a], &a=b\\\\\nnum[a]+sum(a+1, b), &a < b\n\end{cases}\n$$

Input Format

The first line contains a positive integer n  (1<n≤105)n\;(1\lt n \le 10^5).

The second line contains nn positive integers, each less than 10610^6.

The third line contains two integers a,ba, b.

Output Format

Output the sum of the integers in the range [a,b][a, b].

Sample Input

5
1 2 3 4 5
2 4

Sample Output

9

Constraints

1s, 1024KiB for each test case.