#C1283. Towers of Cubes
Towers of Cubes
Towers of Cubes
Given n cubes and their types, compute the maximum number of towers that can be constructed and the maximum height of any tower. A tower is built using cubes of the same type. Essentially, the number of towers is the number of unique cube types, and the height of the tallest tower is the maximum occurrence count of any type.
inputFormat
The first line contains an integer n. The second line contains n space-separated integers representing the cube types.
outputFormat
Output two integers separated by a space. The first integer is the maximum number of towers (distinct cube types) and the second integer is the maximum height among the towers.## sample
8
1 2 3 1 2 3 1 2
3 3