import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int house = sc.nextInt();
int totalWifi = sc.nextInt();
int[] cordi = new int[house];
for(int i=0; i<house ; i++) {
cordi[i] = sc.nextInt();
}
Arrays.sort(cordi);
int lo = 1;
int hi = cordi[house-1]-cordi[0];
int answer = (lo+hi)/2;
while ((hi >= lo)) {
int mid = (lo+hi)/2;
int count = 1;
int curStart = cordi[0];
for(int i=0 ; i< house ; i++) {
int dist = cordi[i] - curStart;
if(dist >= mid) {
count++;
curStart = cordi[i];
}
}
if(count >= totalWifi) {
answer = mid;
lo = mid+1;
}
else {
hi = mid-1;
}
}
System.out.println(answer);
return;
}
}