N = int(input())
X = list(map(int, input().split()))

total = 0
m = round(sum(X) / N)

for i in X:
    total += (m - i) ** 2
print(total) 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 total = 0 total 0 m = round(sum(X) / N) m round(sum(X) / N) round sum(X) / N sum(X) sum X N for i in X:
    total += (m - i) ** 2 i X total += (m - i) ** 2 total (m - i) ** 2 m - i m i 2 print(total) print total total += (m - i) ** 2 (m - i) ** 2 total N = int(input()) int(input()) N X = list(map(int, input().split())) list(map(int, input().split())) X total = 0 0 total m = round(sum(X) / N) round(sum(X) / N) m
N = int(input())
X = list(map(int, input().split()))

total = 0
m = round(sum(X) / N)

for i in X:
    total += (m - i) ** 2
print(total)