Problem1072--数苹果

1072: 数苹果

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 123  Solved: 16
[Status] [Submit] [Creator:]

Description

苹果丰收了,有n堆苹果,小红就在苹果堆旁。小红已经知道了每堆苹果有多少个。她要问一问从第a堆到第b堆一共有多少个苹果。

Input

输入数字n,然后输入n个数据。再输入问m,然后输入c行数据。

Output

输出mab堆一共有多少个。

Sample Input Copy

5 
1 2 3 4 5
3
1 3
2 4
1 5

Sample Output Copy

6
9
15

HINT

对于80%的数据:0n10000

对于100%的数据:0n100000

Source/Category