N = int(input())
X = list(map(int, input().split()))
al = []
for i in range(100):
  d = 0
  p = i+1
  for j in range(N):
    d += (X[j]-p)**2
  al.append(d)

print(min(al)) 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 al = [] al [] for i in range(100):
  d = 0
  p = i+1
  for j in range(N):
    d += (X[j]-p)**2
  al.append(d) i range(100) range 100 d = 0 d 0 p = i+1 p i+1 i 1 for j in range(N):
    d += (X[j]-p)**2
   j range(N) range N d += (X[j]-p)**2 d (X[j]-p)**2 X[j]-p X[j] X j p 2 al.append(d) al.append al append d print(min(al)) print min(al) min al N = int(input()) int(input()) N d += (X[j]-p)**2 (X[j]-p)**2 d X = list(map(int, input().split())) list(map(int, input().split())) X d = 0 0 d p = i+1 i+1 p al = [] [] al
N = int(input())
X = list(map(int, input().split()))
al = []
for i in range(100):
  d = 0
  p = i+1
  for j in range(N):
    d += (X[j]-p)**2
  al.append(d)

print(min(al))