You are on the jury of a talent show. In the first round, people from all over the country come to show you their skills, and only a fixed number of them advance to the next round.
Every candidate has been seen, so now the jury has to pick who advances. Each jury member has their own favourites, and after a long discussion it is clear that no consensus will come out of that. Instead, every jury member awards points to a fixed number of candidates, all the points are added up, and the candidates with the most points advance.
Points are given with stickers. Each sticker is worth a fixed number of points, you can put at most one sticker on a candidate, and you have to use all of your stickers.
The discussion already revealed how the other jury members will split their points, so you know what every candidate gets from them. You have your own list of favourites and you want as many of them as possible to advance. How many of your favourites can you get through if you hand out your stickers optimally?
If several candidates end on the same number of points and only some of them can advance, you can use your powers of charm and persuasion to put your own favourites through first.
The first line has one positive integer, the number of test cases, at most 100. Each test case is given as follows.
For each test case, print one line with a single integer: the largest number of your favourites that you can get into the next round.
In the first test case of the first example, put the stickers worth 50, 30, 20 and 10 on the candidates with 47, 37, 29 and 23 points, which brings them to 97, 67, 49 and 33. The other two candidates stay on 71 and 83, so the top two are 97 and 83, and one of your favourites advances.