1456: Accelerator

内存限制:128 MB 时间限制:4.000 S
评测方式:文本比较 命题人:
提交:0 解决:0

题目描述

Shiming (alpc02) is a boy likes to play PopKart very much. He is a good rider in this game. And one day he thought that he became a team leader of a team of N Kart riders. Today, after the game begins, the riders of his team are now at different places at the racetrack, for that some of the riders got some short cut. However, we know actually how long has each rider left to run along, and they will ride actually one meter per one time unit (maybe 10ms). Luckily, Shiming now gets M accelerators, the accelerator can help one rider to ride k meters per one time unit. And all the accelerators are as the same. But one rider can‘t use more than one accelerator at one time unit. Shiming is the team leader, and he wants all the team members to finish in the minimal time not just the fastest one to finish the race. He will distribute all the accelerators to the riders. Note: Here some rules are not as the same as the game we played. At a time unit, Shiming distributes the accelerators to riders for one rider one accelerator, and at the next time unit, all the accelerator can be reused, and Shiming can re-distributes all the accelerators to riders also for one rider one accelerator and the distribution is no relationship with the last time unit. So you will program to help Shiming to get the actually minimal time the team will use to finish the race.

输入

The input file has T (1

输出

For each of test cases print a single integer on a single line, the minimal possible number of time units required to finish the race all team.

样例输入 复制

2
3
2 3 9
1 5
3
2 3 6
1 5

样例输出 复制

3
2

提示

练习赛10-G