N = int(input(""))
X = input("").split(" ")
X = [int(b) for b in X]
ans = 0
xb = int(round(sum(X) / len(X)))
for a in X:
    ans += (a-xb)**2
print(ans) N = int(input("")) N int(input("")) int input("") input "" X = input("").split(" ") X input("").split(" ") ("").split ("") input "" split " " int(b) for b in X for b in X b X for b in X int(b) int b X = [int(b) for b in X] X [int(b) for b in X] ans = 0 ans 0 xb = int(round(sum(X) / len(X))) xb int(round(sum(X) / len(X))) int round(sum(X) / len(X)) round sum(X) / len(X) sum(X) sum X len(X) len X for a in X:
    ans += (a-xb)**2 a X ans += (a-xb)**2 ans (a-xb)**2 a-xb a xb 2 print(ans) print ans X = [int(b) for b in X] [int(b) for b in X] X ans += (a-xb)**2 (a-xb)**2 ans ans = 0 0 ans N = int(input("")) int(input("")) N xb = int(round(sum(X) / len(X))) int(round(sum(X) / len(X))) xb X = input("").split(" ") input("").split(" ") X
N = int(input(""))
X = input("").split(" ")
X = [int(b) for b in X]
ans = 0
xb = int(round(sum(X) / len(X)))
for a in X:
    ans += (a-xb)**2
print(ans)