#include
using namespace std;
bool canPlaceCows(long long a[],long long mid,long long n,long long c){
long long last_cow=a[0];
long long count=1;
for(int i=1;i<n;i++){
if(a[i]-last_cow>=mid){
last_cow=a[i];
count++;
if(count==c)
return true;
}
}
return false;
}
int main(){
long long n,c;
cin>>n>>c;
long long a[n+1];
for(long long i=0;i<n;i++){
cin>>a[i];
}
long long s=0;
long long e=a[n-1]-a[0];
long long ans=0;
while(s<=e){
long long mid=(s+e)/2;
if(canPlaceCows(a,mid,n,c)){
ans=mid;
s=mid+1;
}
else{
e=mid-1;
}
}
cout<<ans<<endl;
return 0;
}