n=int(input())
x = list(map(int,input().split()))
y =[]
b = sum(x)
for i in range(n):
        y.append((x[i])**2)
a = sum(y)

p = round(b/(n))
ans = (n)*p**2-2*p*b+a
print(ans) n=int(input()) n int(input()) int input() input x = list(map(int,input().split())) x list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split y =[] y [] b = sum(x) b sum(x) sum x for i in range(n):
        y.append((x[i])**2) i range(n) range n y.append((x[i])**2) y.append y append (x[i])**2 x[i] x i 2 a = sum(y) a sum(y) sum y p = round(b/(n)) p round(b/(n)) round b/(n) b n ans = (n)*p**2-2*p*b+a ans (n)*p**2-2*p*b+a (n)*p**2-2*p*b (n)*p**2 n p**2 p 2 2*p*b 2*p 2 p b a print(ans) print ans y =[] [] y x = list(map(int,input().split())) list(map(int,input().split())) x n=int(input()) int(input()) n ans = (n)*p**2-2*p*b+a (n)*p**2-2*p*b+a ans b = sum(x) sum(x) b p = round(b/(n)) round(b/(n)) p a = sum(y) sum(y) a
n=int(input())
x = list(map(int,input().split()))
y =[]
b = sum(x)
for i in range(n):
        y.append((x[i])**2)
a = sum(y)

p = round(b/(n))
ans = (n)*p**2-2*p*b+a
print(ans)