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 = input()
l = list(map(int,list(input().split())))
cost_min = (200**2)*100
cost = 0
for i in range(-100,101):
    for j in l:
        cost = (j - i)**2
        if cost < cost_min:
            cost_min = cost
print(cost_min)

N = input()
l = list(map(int,list(input().split())))
cost_min = (200**2)*100
cost = 0
for i in range(-100,101):
    for j in l:
        cost += (j - i)**2
        
    if cost < cost_min:
        cost_min = cost
    cost = 0
print(cost_min)
