b=int(input()) n=int(input()) c=[int(input()) for i in range(n)] c.sort() if n//2==1: t=c[n//2] else: t=(c[n//2-1]+c[n//2])//2 x=sum(c)+b ans=[] for i in range(max(t-10**5,0),t+10**5): if n*i<=x: ct=0 for j in range(n): if c[j]>=i: ct+=c[j]-i for j in range(n): if c[j]