atcoder#ABC143F. [ABC143F] Distinct Numbers
[ABC143F] Distinct Numbers
Score : points
Problem Statement
Takahashi has cards. The -th of these cards has an integer written on it.
Takahashi will choose an integer , and then repeat the following operation some number of times:
- Choose exactly cards such that the integers written on them are all different, and eat those cards. (The eaten cards disappear.)
For each , find the maximum number of times Takahashi can do the operation.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print integers. The -th of them should be the answer for the case .
3
2 1 2
3
1
0
For , we can do the operation as follows:
- Choose the first card to eat.
- Choose the second card to eat.
- Choose the third card to eat.
For , we can do the operation as follows:
- Choose the first and second cards to eat.
For , we cannot do the operation at all. Note that we cannot choose the first and third cards at the same time.
5
1 2 3 4 5
5
2
1
1
1
4
1 3 3 3
4
1
0
0