n=int(input())
x=list(map(int,input().split()))
ans=1000000000000
for p in range(100):
    a=0
    for i in range(n):
        a+=(x[i]-p)**2 
    if a < ans:
        ans = a

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 ans=1000000000000 ans 1000000000000 for p in range(100):
    a=0
    for i in range(n):
        a+=(x[i]-p)**2 
    if a < ans:
        ans = a p range(100) range 100 a=0 a 0 for i in range(n):
        a+=(x[i]-p)**2 
     i range(n) range n a+=(x[i]-p)**2 a (x[i]-p)**2 x[i]-p x[i] x i p 2 if a < ans:
        ans = a a < ans a ans ans = a ans a print(ans) print ans a+=(x[i]-p)**2 (x[i]-p)**2 a ans = a a ans x=list(map(int,input().split())) list(map(int,input().split())) x n=int(input()) int(input()) n ans=1000000000000 1000000000000 ans a=0 0 a
n=int(input())
x=list(map(int,input().split()))
ans=1000000000000
for p in range(100):
    a=0
    for i in range(n):
        a+=(x[i]-p)**2 
    if a < ans:
        ans = a

print(ans)