#include<bits/stdc++.h>
using namespace std;
#define int long long
int b[100000005],n,m,d,ma,x;
bool find(int k,int a[]){
if (k*n<m) return 0;
int now=1;
for (int i=1;i<=n;i++){
if ((now==ma&&a[now]==0)||now>ma) return 1;
if (i-now>d) return 0;
while ((!a[now])&&now<=i) now++;
int jjj=k;
while (now<=i&&a[now]<=jjj){
jjj-=a[now];
a[now]=0;
now++;
}
a[now]-=jjj;
if (i-now>=d) return 0;
}
return 1;
}
signed main(){
scanf("%lld%lld%lld",&n,&d,&m);
for (int p=1;p<=m;p++){
scanf("%lld",&x);
ma=max(x,ma);
b[x]++;
}
int res=1;
while (!find(res,b)) res++;
printf("%lld",res);
return 0;
}
代码不是很好看 见谅