Problem1516--连续一段数的和

1516: 连续一段数的和

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

已知N个数,求这N个数中某一段数的和。

Input

第一行有一个数N(3<=N<=300)其中N为数的个数

第二行有N个整数

第三行有两个整数A、B,A为这N个数中的第A个数,B为这N个数中的第B个数。

Output

仅一个数,即从第A个数开始至第B个数为止的所有数的和。

Sample Input Copy

5 
4 3 5 7 1
2 4

Sample Output Copy

15

Source/Category