Problem: you are given an array of size N. You need to select K elements from the array such that the difference between the max number among selected and the min number among selected array elements should be minimum. Print the minimum difference.

INPUT:
First line N number i.e., length of array
Second line K number 
Next N lines contains a number for each line

OUTPUT:
Print the minimum possible difference

0<N<10^5
0<K<N
0<number<10^9

SAMPLE INPUT
5
3
1
2
3
4
5

SAMPLE OUTPUT
2

Solution (in PYTHON):

Solution:
def f(n,k):
    s=[]
    mn=9999999999
    for i in range(n):
        t=int(raw_input())
        s.append(t)
    s.sort()
    for i in range(k,n):
        if (s[i]-s[i-k+1])<mn:
            mn=s[i]-s[i-k+1]
    return mn
n=int(raw_input())
k=int(raw_input())
print f(n,k)