#P1642B. Power Walking
Power Walking
No submission language available for this problem.
Description
Sam is a kindergartener, and there are children in his group. He decided to create a team with some of his children to play "brawl:go 2".
Sam has power-ups, the -th has type . A child's strength is equal to the number of different types among power-ups he has.
For a team of size , Sam will distribute all power-ups to children in such a way that each of the children receives at least one power-up, and each power-up is given to someone.
For each integer from to , find the minimum sum of strengths of a team of children Sam can get.
Each test contains multiple test cases. The first line contains a single integer () — the number of test cases. Description of the test cases follows.
The first line of each test case contains a single integer ().
The second line contains integers () — types of Sam's power-ups.
It is guaranteed that the sum of over all test cases does not exceed .
For every test case print integers.
The -th integer should be equal to the minimum sum of strengths of children in the team of size that Sam can get.
Input
Each test contains multiple test cases. The first line contains a single integer () — the number of test cases. Description of the test cases follows.
The first line of each test case contains a single integer ().
The second line contains integers () — types of Sam's power-ups.
It is guaranteed that the sum of over all test cases does not exceed .
Output
For every test case print integers.
The -th integer should be equal to the minimum sum of strengths of children in the team of size that Sam can get.
Samples
Note
One of the ways to give power-ups to minimise the sum of strengths in the first test case:
One of the ways to give power-ups to minimise the sum of strengths in the second test case: