n = int(input())
x = list(map(int,input().split()))
k = []
def kyori(p):
  m = 0
  for i in range(n):
    m += (p-x[i])**2
  return m
for i in range(1,101):
  k.append(kyori(i))

print(min(k)) 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 k = [] k [] def kyori(p):
  m = 0
  for i in range(n):
    m += (p-x[i])**2
  return m kyori m = 0 m 0 for i in range(n):
    m += (p-x[i])**2
   i range(n) range n m += (p-x[i])**2 m (p-x[i])**2 p-x[i] p x[i] x i 2 return m m p p for i in range(1,101):
  k.append(kyori(i)) i range(1,101) range 1 101 k.append(kyori(i)) k.append k append kyori(i) kyori i print(min(k)) print min(k) min k x = list(map(int,input().split())) list(map(int,input().split())) x n = int(input()) int(input()) n k = [] [] k def kyori(p):
  m = 0
  for i in range(n):
    m += (p-x[i])**2
  return m def kyori(p):
  m = 0
  for i in range(n):
    m += (p-x[i])**2
  return m kyori
n = int(input())
x = list(map(int,input().split()))
k = []
def kyori(p):
  m = 0
  for i in range(n):
    m += (p-x[i])**2
  return m
for i in range(1,101):
  k.append(kyori(i))

print(min(k))