To get into university, you are required to have a high average, so your advisor offers you a challenge:
If you can answer my
queries, I will boost your average by .
Each query will consist of
Input Specification
The first line will contain
The second line will contain
The next
Note: Fast I/O might be required to fully solve this problem (e.g., BufferedReader for Java).
Output Specification
Output
Constraints
For all subtasks:
Subtask 1 [50%]
Subtask 2 [50%]
No additional constraints.
Sample Input
5 3
100 50 0 75 90
1 2
2 3
2 5
Sample Output
75
25
53
Comments