Evi has N integers a_1,a_2,..,a_N. His objective is to have N equal **integers** by transforming some of them.  He may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (See Sample 2).  Find the minimum total cost to achieve his objective.
N=int(input())
M=list(map(int,input().split()))
min(sum([(M[j]-i)**2 for j in range(N)]) for i in range(-100,101))
N=int(input())
M=list(map(int,input().split()))
print(min(sum([(M[j]-i)**2 for j in range(N)]) for i in range(-100,101)))