a=int(input()) b=int(input()) c=[] for i in a: b.append(int(input())) b.sort() if a%2==0: d=c[len(c)-1]+c[len(c)-2]/2 e=c[0]+c[1]/2 print(d-e) else: d=c[len(c)-1] e=c[0]+c[1]/2 print(d-e)