#P2649. 游戏预言
游戏预言
Description
John and his friends are playing a card game with people in total (including John). Their deck is special: there are cards numbered , with no duplicate numbers. Each person first receives cards. Then, in each round, everyone plays one card; the highest number wins that round. Now, given the cards in John's hand, compute the minimum number of rounds he can win.
Input Format
The first line contains two integers and .
The second line contains positive integers, the values of the cards in John's hand.
Output Format
Output a single integer, the minimum number of rounds John can win.
2 5
1 7 2 10 9
2
6 11
62 63 54 66 65 61 57 56 50 53 48
4
Hint
Constraints: For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号