#Lutece0293. Minimum Sum
Minimum Sum
Migrated from Lutece 293 Minimum Sum
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
You are given positive integers, denoted as . Then give you some intervals . For each interval, you need to find a number to make as small as possible!
Input
The first line is an integer (), indicating the number of test cases. For each test case, an integer () comes first. Then comes positive integers () in the next line. Finally, comes an integer (), indicting there are queries. Each query consists of two integers , (), meaning the interval you should deal with.
Output
For the test case, first output Case #k:
in a separate line. Then output lines, each line is the minimum value of . Output a blank line after every test case.
Samples
2
5
3 6 2 2 4
2
1 4
0 2
2
7 7
2
0 1
1 1
Case #1:
6
4
Case #2:
0
0
Resources
2010 ACM-ICPC Multi-University Training Contest 13 Host by UESTC