P28596 [洛谷] Game Prediction
普及+
题目描述

Problem Description

John and his friends are playing a card game, with a total of $m$ people (including John). Their cards are special, consisting of $n \times m$ cards numbered from $1$ to $n \times m$, with no duplicate card numbers. Each person initially receives $n$ cards. In each round, everyone plays one card, and the person with the highest card wins the round. Given the $n$ cards in John's hand, calculate the minimum number of rounds he can win.

Input Format

The first line contains two integers, $m$ and $n$.

The second line contains $n$ positive integers, representing the values of the $n$ cards in John's hand.

Output Format

A single integer representing the minimum number of rounds John can win.

Sample Input and Output

Sample Input #1

2 5
1 7 2 10 9

Sample Output #1

2

Sample Input #2

6 11
62 63 54 66 65 61 57 56 50 53 48

Sample Output #2

4

Notes

For $100\%$ of the data, $2 \le m \le 20$, $1 \le n \le 50$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
2 5 1 7 2 10 9
样例输出
2