#P2062. 分队问题
分队问题
Description
Given players, partition them into several teams. The -th player requires that the size of their team be at least .
Subject to satisfying all players' requirements, maximize the total number of teams.
Note: Each player belongs to exactly one team.
Input Format
The first line contains an integer , the number of people.
The next lines each contain an integer .
Output Format
Output the maximum possible number of teams. It is guaranteed that a solution exists.
5
2
1
2
2
3
2
Hint
- For 20% of the testdata, .
- For 40% of the testdata, .
- For 60% of the testdata, .
- For 100% of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号