# coding: utf-8 from itertools import combinations import math def II(): return int(input()) def ILI(): return list(map(int, input().split())) N = II() K = II() n = [II() for __ in range(N)] sum_n = sum(n) s_n = set(n) ans = -1 for i in range(1, N - 2): for comb_1 in combinations(n, i): s_comb_1 = set(comb_1) sum_comb_1 = sum(comb_1) ave_comb_1 = sum_comb_1 / i s_others = s_n - s_comb_1 for j in range(1, N - i - 2): for comb_2 in combinations(s_others, j): sum_comb_2 = sum(comb_2) ave_comb_2 = sum_comb_2 / j sum_comb_3 = sum_n - sum_comb_1 - sum_comb_2 ave_comb_3 = sum_comb_3 / (N - i - j) dif = math.floor(max(ave_comb_1, ave_comb_2, ave_comb_3) - min(ave_comb_1, ave_comb_2, ave_comb_3)) ans = max(ans, dif) print(ans)