/// Angry Cow (Silver)
/// Author: Qwerty
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 50010;
int n, k;
int a[MAXN];
bool check(int d){
int curl = a[1];
int curr = a[1] + 2 * d;
int cnt = 1;
for (int i = 1; i <= n; i++){
if (a[i] >= curl && a[i] <= curr){
continue;
}
cnt++;
curl = a[i];
curr = a[i] + 2 * d;
}
return cnt <= k;
}
int main(){
//freopen("angry.in", "r", stdin);
//freopen("angry.out", "w", stdout);
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> k;
for (int i = 1; i <= n; i++){
cin >> a[i];
}
sort(a + 1, a + n + 1);
int l = 1;
int r = 1e9;
int ans = 0;
while (l <= r){
int mid = (l + r) / 2;
if (check(mid)){
ans = mid;
r = mid - 1;
}
else l = mid + 1;
}
cout << ans << '\n';
}
Ly8vIEFuZ3J5IENvdyAoU2lsdmVyKQovLy8gQXV0aG9yOiBRd2VydHkKI2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKY29uc3QgaW50IE1BWE4gPSA1MDAxMDsKaW50IG4sIGs7CmludCBhW01BWE5dOwpib29sIGNoZWNrKGludCBkKXsKICAgIGludCBjdXJsID0gYVsxXTsKICAgIGludCBjdXJyID0gYVsxXSArIDIgKiBkOwogICAgaW50IGNudCA9IDE7CiAgICBmb3IgKGludCBpID0gMTsgaSA8PSBuOyBpKyspewogICAgICAgICBpZiAoYVtpXSA+PSBjdXJsICYmIGFbaV0gPD0gY3Vycil7CiAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgfQogICAgICAgICBjbnQrKzsKICAgICAgICAgY3VybCA9IGFbaV07CiAgICAgICAgIGN1cnIgPSBhW2ldICsgMiAqIGQ7CiAgICB9CiAgICByZXR1cm4gY250IDw9IGs7Cn0KaW50IG1haW4oKXsKICAgIC8vZnJlb3BlbigiYW5ncnkuaW4iLCAiciIsIHN0ZGluKTsKICAgIC8vZnJlb3BlbigiYW5ncnkub3V0IiwgInciLCBzdGRvdXQpOwogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbygwKTsKICAgIGNpbi50aWUoMCk7CiAgICBjaW4gPj4gbiA+PiBrOwogICAgZm9yIChpbnQgaSA9IDE7IGkgPD0gbjsgaSsrKXsKICAgICAgICAgY2luID4+IGFbaV07CiAgICB9CiAgICBzb3J0KGEgKyAxLCBhICsgbiArIDEpOwogICAgaW50IGwgPSAxOwogICAgaW50IHIgPSAxZTk7CiAgICBpbnQgYW5zID0gMDsKICAgIHdoaWxlIChsIDw9IHIpewogICAgICAgICBpbnQgbWlkID0gKGwgKyByKSAvIDI7CiAgICAgICAgIGlmIChjaGVjayhtaWQpKXsKICAgICAgICAgICAgIGFucyA9IG1pZDsKICAgICAgICAgICAgIHIgPSBtaWQgLSAxOwogICAgICAgICB9CiAgICAgICAgIGVsc2UgbCA9IG1pZCArIDE7CiAgICB9CiAgICBjb3V0IDw8IGFucyA8PCAnXG4nOwp9Cg==