#include <iostream>
#include <cstdio>
#define MAXN 100000
using namespace std;
int l,n,m,ans;
int stone[MAXN];
bool check(int mins)
{
int k=0,count=0;
for (int i=1;i<=n;i++){
if (stone[i]-k<mins){
count++;
if (count>m){
return false;
}
}else{
k=stone[i];
}
}
return true;
}
int main()+
{
cin>>l>>n>>m;
stone[0]=0;
for (int i=1;i<=n;i++){
cin>>stone[i];
}
stone[++n]=l;
int L=1,R=l,mid;
while (L<R){
mid=(L+R)/2;
if (check(mid)){
ans=mid;
L=mid+1;
}else{
R=mid;
}
}
cout<<ans<<endl;
}
NOIP 2015提高组 跳石头
最新推荐文章于 2024-09-28 14:50:41 发布