把a数组的大小改为50001就有50,不改就只有40
#include<bits/stdc++.h>
using namespace std;
int M,N,cnt;
long long L,a[60001],zuo,you,zhong,ans;
bool check(long long x){
long long xx=0,str=0;
for(int i=1;i<=N+1;i++){
if(a[i]-a[str]<x) xx++;
else str=i;
}
if(xx>M) return 0;
else return 1;
}
int main(){
cin >> L >> N >> M;
if(N==0){
cout << L;
return 0;
}
zuo=0;
you=1e9+10;
for(int i=1;i<=N;i++) cin >> a[i];
while(zuo<=you){
zhong=(zuo+you)/2;
if(check(zhong)){
zuo=zhong+1;
ans=zhong;
}else{
you=zhong-1;
}
}
cout << ans;
}