f = lambda n:sum(sorted(n*4)[len(n):-len(n)])/len(n)/2 print(f([1,3,4,5,6,6,7,7,8,8,9,38])) print(f([1,3,5,7,9,11,13,15,17]))