#K11801. Sustainable Study Group

    ID: 23549 Type: Default 1000ms 256MiB

Sustainable Study Group

Sustainable Study Group

In a coding study group, there are q participants and p coding problems available. Each problem is associated with a difficulty level. Every day, each participant must receive exactly one problem. However, from problems of the same difficulty, at most q problems can be used per day. Therefore, the maximum number of study days is determined by summing, for every unique difficulty level, the minimum between its frequency and q, and then dividing that sum by q as follows:

\(\text{days} = \left\lfloor \frac{\sum_{d \in D} \min(\text{count}(d), q)}{q} \right\rfloor\)

Your task is to calculate this maximum number of days given the input.

inputFormat

The input is read from standard input. The first line contains two space-separated integers: q (the number of participants) and p (the number of coding problems). The second line contains p space-separated integers representing the difficulty levels of the problems.

outputFormat

Output a single integer representing the maximum number of days the study group can be sustained.

## sample
3 7
2 4 2 3 5 6 7
2