시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 3 | 2 | 2 | 66.667% |
You and your team are participating in a programming contest. After reading all problems, you have estimated for each problem how long it will take you to solve it. Your teammates have done exactly the same. Now you want to divide the problems, so that the total number of solved problems will be maximized.
Your team is very organized and each team member always writes down all the details on paper. Therefore the computer never forms a bottleneck. The only constraint is that for each team member, the total time required to solve the problems assigned to him should not exceed the time left in the contest.
On the first line an integer t (1 ≤ t ≤ 100): the number of test cases. Then for each test case:
For each test case:
1 10 300 10 60 -1 -1 10 10 10 240 1 30 15 -1 30 -1 60 60 60 300 5 250 20 -1 -1 60 60 90 90 300 2 245
10