#C11309. Maximum Tower Height
Maximum Tower Height
Maximum Tower Height
You are given several cubes, each with a specific side length. Your task is to build the tallest possible tower under the following restriction: all cubes in the tower must have the same side length. In other words, the height of the tower is the maximum number of cubes having an identical side length.
Mathematically, if you are given an array \( A \) of \( n \) integers, the answer is:
where \( \text{freq}(x) \) is the frequency of \( x \) in \( A \).
inputFormat
The input begins with an integer \( t \) representing the number of test cases. For each test case:
- The first line contains an integer \( n \), the number of cubes.
- The second line contains \( n \) space-separated integers representing the side lengths of the cubes.
outputFormat
For each test case, output a single integer on a new line denoting the maximum tower height that can be built.
## sample5
6
1 2 2 3 3 4
4
4 4 4 4
3
2 9 2
5
5 1 5 1 5
2
100 100
2
4
2
3
2
</p>