Time Limits
InterviewTime limit1sMemory limit1024 MB
For each dataset, find the smallest whole-second time limit that is at least s times the slowest model solution's time in milliseconds.
- Level
Easy2 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
A contest setter wants to set the time limit for a problem. There are model solutions, and model solution takes milliseconds to run on the test data. The time limit must be an integer number of seconds and must be at least times the running time of the slowest model solution. Compute the minimum time limit the setter can choose.
Input
The first line contains a single integer , the number of datasets. Each dataset has two lines. The first line contains two space-separated integers and (, ). The second line contains space-separated integers ( for all ).
Output
For each dataset, print on one line the minimum time limit in seconds as a single integer.