n = int(input())

x = list(map(int, input().split()))

h = round(sum(x) / n)

ans = 0

for i in range(n):
    ans += ((x[i] - h) ** 2)

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 h = round(sum(x) / n) h round(sum(x) / n) round sum(x) / n sum(x) sum x n ans = 0 ans 0 for i in range(n):
    ans += ((x[i] - h) ** 2) i range(n) range n ans += ((x[i] - h) ** 2) ans (x[i] - h) ** 2 x[i] - h x[i] x i h 2 print(ans) print ans n = int(input()) int(input()) n x = list(map(int, input().split())) list(map(int, input().split())) x ans += ((x[i] - h) ** 2) (x[i] - h) ** 2 ans h = round(sum(x) / n) round(sum(x) / n) h ans = 0 0 ans
n = int(input())

x = list(map(int, input().split()))

h = round(sum(x) / n)

ans = 0

for i in range(n):
    ans += ((x[i] - h) ** 2)

print(ans)