NandK = input().split()#[0]=N,[1]=K
for x in range(len(NandK)):
NandK[x] = int(NandK[x])
N = input().split()
for x in range(len(N)):
N[x] = int(N[x])
N.sort()
Nmax = max(N)
Nmin = min(N)
def test(R):
num = 1
nowpos = Nmin
for x in range(len(N)):
if N[x] > nowpos+R-1:
num += 1
nowpos = N[x]
return(num)
maxrange = Nmax - Nmin + 1
minrange = 1
while maxrange - minrange > 1:
Radius = (maxrange + minrange)//2
nowK = test(Radius)
if nowK > NandK[1]:
minrange = Radius
if nowK <= NandK[1]:
maxrange = Radius
print(Radius)