#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int a[550000]={0};
int l,m,n;
int judge(int mid)
{
int j;
int t=0;
int g=0;
for(j=1;j<=m+1;j++)
{
if(a[j]-g<=mid)
t++;
else g=a[j];
}
if(t>n)return 0;
else return 1;
}
int main()
{
scanf("%d%d%d",&l,&m,&n);
int i;
a[m+1]=l;
for(i=1;i<=m;i++)
scanf("%d",&a[i]);
int le=0;
int ri=l;
int mid;
while(le<=ri)
{
mid=(le+ri)/2;
if(judge(mid)==0)ri=mid-1;
else le=mid+1;
}
cout<<le<<endl;
return 0;
}
1247:河中跳房子
最新推荐文章于 2024-07-22 15:07:20 发布