#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cstdio>
using namespace std;
#define maxn 100000
int n, m, x[maxn];
int Max;
bool judge(int d)
{
int cnt = 1;
int a = x[0];
for(int i=1; i<n; i++)
{
if(a + d <= x[i])
{
a = x[i];
cnt++;
}
}
return cnt >= m ;
}
void solve()
{
sort(x, x+n);
int L = 0;
int R = Max;
while(L + 1 < R)
{
int mid = (L + R) >> 1;
if(judge(mid)) L = mid;
else R = mid;
}
cout<<L<<endl;
}
int main()
{
while(~scanf("%d%d", &n, &m))
{
Max = -1;
for(int i=0; i<n; i++)
{
scanf("%d", &x[i]);
Max = max(Max, x[i]);
}
solve();
}
return 0;
}