#P7585. [COCI 2012/2013 #1] LJUBOMORA
[COCI 2012/2013 #1] LJUBOMORA
Description
A marble factory donated some marbles to a kindergarten. There are different colors of marbles, and each marble has exactly one color. The teacher needs to distribute all the marbles to children. All marbles given to the same child must be of the same color, and some children may receive no marbles at all.
We define the jealousy value as the maximum number of marbles given to any single child. Please help the teacher distribute the marbles so that the jealousy value is as small as possible.
For example, if there are red marbles () and blue marbles (), to be distributed among children, we can distribute them as: , , , , . The jealousy value is then , and this is the minimum possible.
Input Format
The input has lines.
The first line contains two positive integers , representing the number of children and the total number of colors of marbles.
In the next lines, the -th line contains a positive integer (), meaning there are marbles of color .
Output Format
Output one line with one integer, representing the minimum jealousy value.
5 2
7
4
3
7 5
7
1
7
4
4
4
Hint
Constraints
For of the testdata, it is guaranteed that , , and .
Notes
The score of this problem follows the original COCI settings, with a full score of .
Translated from COCI2012-2013 CONTEST #1 T4 LJUBOMORA.
Translated by ChatGPT 5
京公网安备 11011102002149号