n=int(input())
x=list(map(int,input().split()))
res=10**10
for i in range(1,101):
  sum = 0
  for j in range(n):
    sum+=(x[j]-i)**2
  if sum < res:
    res=sum
print(res) 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 res=10**10 res 10**10 10 10 for i in range(1,101):
  sum = 0
  for j in range(n):
    sum+=(x[j]-i)**2
  if sum < res:
    res=sum i range(1,101) range 1 101 sum = 0 sum 0 for j in range(n):
    sum+=(x[j]-i)**2
   j range(n) range n sum+=(x[j]-i)**2 sum (x[j]-i)**2 x[j]-i x[j] x j i 2 if sum < res:
    res=sum sum < res sum res res=sum res sum print(res) print res x=list(map(int,input().split())) list(map(int,input().split())) x n=int(input()) int(input()) n sum+=(x[j]-i)**2 (x[j]-i)**2 sum res=10**10 10**10 res res=sum sum res sum = 0 0 sum
n=int(input())
x=list(map(int,input().split()))
res=10**10
for i in range(1,101):
  sum = 0
  for j in range(n):
    sum+=(x[j]-i)**2
  if sum < res:
    res=sum
print(res)