N=int(input()) K=int(input()) X=[] for _ in range(N): X.append(int(input())) X.sort() r=X[-1]-X[0] print(-(-r//2))