#include<iostream>
#include<algorithm>
#define N 100010
using namespace std;
int a[N];
int n, c;
bool Judge(int x)
{
int tmp = 1;
int cnt = 1;
for(int i = 2; i <= n; i++)
{
if(a[i] - a[tmp] >= x)
cnt++;
tmp = i;
}
if(cnt >= c)
return true;
else
return false;
}
int main()
{
cin >> n >> c;
for(int i = 1; i <= n; i++)
cin >> a[i];
sort(a + 1, a + n + 1);
int l = 0, r = a[n] - a[1], mid;
while(l < r)
{
mid = l + (r - l) / 2;
if(Judge(mid))
l = mid + 1;
else
r = mid;
}
cout << l;
return 0;
}