ll n,a,y[999999],t[999999];{rd(n,y(n));sort(y,y+n);a=y[n/2];t[1..n]=abs(y[0..]-a);wt(t[n]);}