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


avg = sum(X) / N
avgi = int(avg + 0.5)

ans = 0
for i in X:
#    print((i-avgi)*(i-avgi))
    ans += (i-avgi)**2

print(ans) N=int(input()) N int(input()) int input() input X=map(int, input().split()) X map(int, input().split()) map int input().split() ().split () input split X = list(X) X list(X) list X avg = sum(X) / N avg sum(X) / N sum(X) sum X N avgi = int(avg + 0.5) avgi int(avg + 0.5) int avg + 0.5 avg 0.5 ans = 0 ans 0 for i in X:
#    print((i-avgi)*(i-avgi))
    ans += (i-avgi)**2 i X ans += (i-avgi)**2 ans (i-avgi)**2 i-avgi i avgi 2 print(ans) print ans N=int(input()) int(input()) N X = list(X) list(X) X X=map(int, input().split()) map(int, input().split()) X avgi = int(avg + 0.5) int(avg + 0.5) avgi ans += (i-avgi)**2 (i-avgi)**2 ans ans = 0 0 ans avg = sum(X) / N sum(X) / N avg
N=int(input())
X=map(int, input().split())
X = list(X)


avg = sum(X) / N
avgi = int(avg + 0.5)

ans = 0
for i in X:
#    print((i-avgi)*(i-avgi))
    ans += (i-avgi)**2

print(ans)
