program Project2; var t : array of integer; n, j, k, i, l : integer; f, g : text; procedure sort(); var max, min, pamat, o : integer; begin for i := 1 to n do begin j := i + 1; while j <= n do begin if t[i] < t[j] then begin pamat := t[i]; t[i] := t[j]; t[j] := pamat; end; inc(j); end; end; end; procedure kinz(); var ii, jj, rizn, o : integer; begin rizn := 100000; for ii := 1 to n do begin for jj := 1 to n do begin o := t[ii] - t[jj]; if (o < rizn) and ((jj - ii) > (k - 2)) and (o > 0) then begin rizn := o; end; end; end; writeln(g, rizn); end; begin assign (f, 'holy.in'); reset(f); read(f, n, k); setlength(t, n + 1); assign(g, 'holy.out'); rewrite(g); for i := 1 to n do read(f, t[i]); i := 1; j := 1; sort(); kinz(); close(g); { TODO -oUser -cConsole Main : Insert code here } end.