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()
n_list = list(map(int, input().split()))
max_sum = 0

for i in range(-100, 101):
  sum = 0
  for a in n_list:
    sum += (i - a) ^ 2
  max_sum = max(max_sum, sum)
  
print(max_sum)
n = input()
n_list = list(map(int, input().split()))
min_sum = float('inf')

for i in range(-100, 101):
  total = 0
  for a in n_list:
    total += pow((a - i), 2)
  min_sum = min(min_sum, total)

print(min_sum)
