include[HTML_REMOVED]
include[HTML_REMOVED]
using namespace std;
typedef long long ll;
int n, m;
int a[100010], diff[100010];
bool check(ll mid){
int num = 1;
int cnt = a[0];
for(int i = 1; i < n; i){
if(a[i] - cnt >= mid){
num ;
if(num >= m) return true;
cnt = a[i];
}
}
return false;
}
int main(){
cin >> n >> m;
for(int i = 0; i < n; i++) cin >> a[i];
sort(a, a + n);
ll l = 0, r = a[n-1]+1;
while(l + 1 != r){
ll mid = (l + r)/2;
if(check(mid)) l = mid;
else r = mid;
}
cout << l;
return 0;
}