N = int(input())
X = list(map(int, input().split()))
small = 10000000
temp = 0
p_max = max(X)

for p in range(1, p_max + 1):
  for i in range(N):
    temp += (X[i] - p)**2
    
  if temp < small:
    small = temp
  
  temp = 0
  
print(small) 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 small = 10000000 small 10000000 temp = 0 temp 0 p_max = max(X) p_max max(X) max X for p in range(1, p_max + 1):
  for i in range(N):
    temp += (X[i] - p)**2
    
  if temp < small:
    small = temp
  
  temp = 0
   p range(1, p_max + 1) range 1 p_max + 1 p_max 1 for i in range(N):
    temp += (X[i] - p)**2
    
   i range(N) range N temp += (X[i] - p)**2 temp (X[i] - p)**2 X[i] - p X[i] X i p 2 if temp < small:
    small = temp
  
   temp < small temp small small = temp small temp temp = 0 temp 0 print(small) print small p_max = max(X) max(X) p_max small = temp temp small temp = 0 0 temp small = 10000000 10000000 small temp += (X[i] - p)**2 (X[i] - p)**2 temp temp = 0 0 temp N = int(input()) int(input()) N X = list(map(int, input().split())) list(map(int, input().split())) X
N = int(input())
X = list(map(int, input().split()))
small = 10000000
temp = 0
p_max = max(X)

for p in range(1, p_max + 1):
  for i in range(N):
    temp += (X[i] - p)**2
    
  if temp < small:
    small = temp
  
  temp = 0
  
print(small)
