output_description: Print the minimum total cost to achieve Evi's objective.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N
      a_1 a_2 ... a_N
attempt: a,b=int(input()),list(map(int,input().split()));b.sort();c=(b[0]+b[-1])//2;if (b[0]+b[-1])%2==1 and c+1 in b:c+=1;d=[(b[i]-c)**2 for i in range(a)];print(sum(d))
problem_description: Statement
  
  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.
samples: [{"input": "2\n    4 8", "output": "8\n    \n\nTransforming the both into 6s will cost (4-6)^2+(8-6)^2=8 dollars, which is\nthe minimum.\n\n* * *"}, {"input": "3\n    1 1 3", "output": "3\n    \n\nTransforming the all into 2s will cost (1-2)^2+(1-2)^2+(3-2)^2=3 dollars. Note\nthat Evi has to pay (1-2)^2 dollar separately for transforming each of the two\n1s.\n\n* * *"}, {"input": "3\n    4 2 5", "output": "5\n    \n\nLeaving the 4 as it is and transforming the 2 and the 5 into 4s will achieve\nthe total cost of (2-4)^2+(5-4)^2=5 dollars, which is the minimum.\n\n* * *"}, {"input": "4\n    -100 -100 -100 -100", "output": "0\n    \n\nWithout transforming anything, Evi's objective is already achieved. Thus, the\nnecessary cost is 0."}]