|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|3 초||256 MB||26||7||7||38.889%|
You find yourself in the jury of a talent show. In the first round, people from all over the country come around to show you their skills. Only a certain number of people can be allowed to advance to the next round.
Now that all candidates have been seen, it is time to select the people who will advance. Every jury member has some favourites they want to put forward. After a lot of discussion, it is clear that no consensus will be reached this way. They decide to let every jury member award points to a certain number of candidates. The points are all added up and the candidates with the most points advance.
You have your own list of favourites, of whom you would like to let as many as possible advance. Fortunately, from the discussion, it is quite obvious how all the other jury members are going to divide their points. Points are assigned using stickers. Each sticker is worth a certain number of points and you can only assign one sticker to a candidate. Furthermore all stickers have to be assigned. How many of your favourites can you get through if you distribute your stickers optimally?
Should there be some candidates with the same number of points of whom only some can advance, you can use your powers of charm and persuasion to get as many of your favourites through as possible.
On the first line one positive number: the number of test cases, at most 100. After that per test case:
Per test case:
3 6 2 4 23 29 37 47 71 83 4 10 20 30 50 5 3 3 40 60 80 85 85 4 10 20 30 50 6 3 3 14 15 92 65 35 89 4 10 20 30 50
1 2 2
A sticker distribution for the first sample input that advances one of your favorites.