1370: 利用数组求一段数的和

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:8 Solved:5

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