n = int(input())
l = list(map(int,input().split()))
min_sum = 10**9
for i in range(min(l),max(l)+1):
    min_sum = min(min_sum,sum([(j-i)**2 for j in l]))

print(min_sum) n = int(input()) n int(input()) int input() input l = list(map(int,input().split())) l list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split min_sum = 10**9 min_sum 10**9 10 9 for i in range(min(l),max(l)+1):
    min_sum = min(min_sum,sum([(j-i)**2 for j in l])) i range(min(l),max(l)+1) range min(l) min l max(l)+1 max(l) max l 1 (j-i)**2 for j in l for j in l j l for j in l (j-i)**2 j-i j i 2 min_sum = min(min_sum,sum([(j-i)**2 for j in l])) min_sum min(min_sum,sum([(j-i)**2 for j in l])) min min_sum sum([(j-i)**2 for j in l]) sum [(j-i)**2 for j in l] print(min_sum) print min_sum min_sum = min(min_sum,sum([(j-i)**2 for j in l])) min(min_sum,sum([(j-i)**2 for j in l])) min_sum min_sum = 10**9 10**9 min_sum l = list(map(int,input().split())) list(map(int,input().split())) l n = int(input()) int(input()) n
n = int(input())
l = list(map(int,input().split()))
min_sum = 10**9
for i in range(min(l),max(l)+1):
    min_sum = min(min_sum,sum([(j-i)**2 for j in l]))

print(min_sum)