12584 - The Beauty of Distributing   

Description

Little brick is once playing a RPG game.
In this game, there are some magical reels(魔法卷軸) that can increase your skill level.
As a serious OCD patient (強迫症患者),
he can only accept that every skill he has is at the same level.

At the beginning, every skill is at level 0,
and he has N magical reels,
the ith reel can increase one of his skill by Xi levels.
LittleBrick wants to have as many skills as possible,
and he also want to use all N reels.

Tell LittleBrick what is the maximum number of skills he may have.

ouo.

 

For Example 1: 
6
1 1 2 2 3 3
The answer is 4, since you can make 4 skills to reach the same level 3,
by distributing the reels like (1, 2), (3), (1, 2), (3)

For Example 2: 
5
1 1 2 5 3
The answer is 2, since you can make 2 skills to reach the same level 6,
by distributing the reels like (1, 5), (1, 2, 3)

For Example 3
3
1 2 4
The answer is 1, since you can make only 1 skill to reach the same level 7,
by distributing the reels like (1, 2, 4)

Input

The first line contains an integer T, represent the number of test cases.
For each test case, the first line is an integer N,
which represents the number of reels LittleBrick has.
The next lines contain N number Xseparated by spaces,
which represents the number of levels the ith reels can increase to a single skill.

It is guarantee that:
1 <= T <= 10,
1 <= N <= 10,
1 <= Xi <= 100

Output

For each test case,
output the maximum number of skills LittleBrick can learn,
and a newline character after the answer.

Sample Input  Download

Sample Output  Download

Tags




Discuss