Problem A
Array Smoothening
You’ve just finished writing a random array generator for
your competitive programming practical examination
problem. However, when you tested it, you noticed that the
distribution is skewed; some values may appear much more times
than the other values. You wanted to smoothen the distribution,
but you don’t want to modify your generator anymore. Thus, you
decide to remove exactly
Input
The first line contains two integers
The next line contains
Output
Print the minimum possible maximum occurrence of a value of
Subtasks
-
(
Points): , , , and is sorted in non-decreasing order. -
(
Points): , , and . -
(
Points): and . -
(
Points): . -
(
Points): . -
(
Points): No additional constraints.
Explanation
In the first sample,
In the second sample, we can remove two occurrences of
Warning
The I/O files are large. Please use fast I/O methods.
Sample Input 1 | Sample Output 1 |
---|---|
10 0 1 1 3 3 3 3 3 7 7 7 |
5 |
Sample Input 2 | Sample Output 2 |
---|---|
10 3 3 1 7 3 3 3 7 3 1 7 |
3 |