1160: 线段树

Memory Limit:512 MB Time Limit:2.000 S
Judge Style:Text Compare Creator:
Submit:1 Solved:1

Description

Sample Input Copy

10
3 1 2 9 6 4 5 7 8
3
7 6 7
18 4 5
14 5 6

Sample Output Copy

7
11
3

HINT

Source/Category