#C6721. Minimum Number of Teams

    ID: 50513 Type: Default 1000ms 256MiB

Minimum Number of Teams

Minimum Number of Teams

Alice is organizing a coding competition and wishes to form teams in such a way that no team contains more than one participant with the same skill level. Given the total number of participants, the number of distinct skill levels available, and a list of participants' skill levels, your task is to determine the minimum number of teams required.

The key observation is that each team can contain at most one participant from each skill level. To minimize the number of teams, you must distribute the participants so that the most frequent skill level determines the minimum number of teams needed. In other words, if a skill appears with a frequency of \( f \), then at least \( f \) teams are needed in order to ensure no team has two participants of that skill.

Mathematically, if \( c_i \) is the number of participants with skill level \( i \), the answer is given by:

[ \text{Minimum Teams} = \max_{1 \le i \le K} c_i ]

inputFormat

The input is given via stdin in the following format:

  • The first line contains two space-separated integers \( N \) and \( K \), where \( N \) is the total number of participants and \( K \) is the number of distinct skill levels.
  • The second line contains \( N \) space-separated integers representing the skill levels of each participant.

outputFormat

Output a single integer representing the minimum number of teams required. The output should be printed to stdout.

## sample
6 3
1 2 3 1 2 3
2