#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
bool IsValid(int C,int rmax,vector<int> vecstalls)
{
int c=1,nstart=vecstalls[0];
for(int i=1;i<vecstalls.size();i++)
{
if(vecstalls[i]-nstart>=rmax)
{
c++;
nstart=vecstalls[i];
}
}
if(c>=C)
{
return true;
}
else
{
return false;
}
}
int main()
{
int N=0,C=0;
cin>>N>>C;
vector<int> vecstalls;
while((N--)>0)
{
int n=0;
cin>>n;
vecstalls.push_back(n);
}
sort(vecstalls.begin(),vecstalls.end());
int lmin=0,rmax=vecstalls[vecstalls.size()-1]/C;
int retvalue=(lmin+rmax)/2;
while(lmin!=rmax)
{
if(lmin==(rmax-1))
{
if(IsValid(C,rmax,vecstalls))
{
retvalue=rmax;
break;
}
else if(IsValid(C,lmin,vecstalls))
{
retvalue=lmin;
break;
}
}
if(IsValid(C,retvalue,vecstalls))
{
lmin=lmin+(rmax-lmin)/2;
}
else
{
rmax=rmax-(rmax-lmin)/2;
}
retvalue=(rmax+lmin)/2;
}
cout<<retvalue<<endl;
return 0;
}