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

X_g = sum(X)/N

if X_g%1<0.5:
    P = int(X_g)
else:
    P = int(X_g)+1
ans = 0
for i in range(N):
    ans += (X[i]-P)**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 X_g = sum(X)/N X_g sum(X)/N sum(X) sum X N if X_g%1<0.5:
    P = int(X_g)
else:
    P = int(X_g)+1 X_g%1<0.5 X_g%1 X_g 1 0.5 P = int(X_g) P int(X_g) int X_g P = int(X_g)+1 P int(X_g)+1 int(X_g) int X_g 1 ans = 0 ans 0 for i in range(N):
    ans += (X[i]-P)**2 i range(N) range N ans += (X[i]-P)**2 ans (X[i]-P)**2 X[i]-P X[i] X i P 2 print(ans) print ans ans = 0 0 ans X_g = sum(X)/N sum(X)/N X_g N = int(input()) int(input()) N P = int(X_g)+1 int(X_g)+1 P X = list(map(int, input().split())) list(map(int, input().split())) X P = int(X_g) int(X_g) P ans += (X[i]-P)**2 (X[i]-P)**2 ans
N = int(input())
X = list(map(int, input().split()))

X_g = sum(X)/N

if X_g%1<0.5:
    P = int(X_g)
else:
    P = int(X_g)+1
ans = 0
for i in range(N):
    ans += (X[i]-P)**2

print(ans)
