n = int(input())
x = list(map(int, input().split()))

min_x = 100 * 100 * 100 + 1
for p in range(1, 100+1, 1):
  total = 0
  for xi in x:
    total += (xi - p) ** 2

  min_x = min([min_x, total])

print(min_x)
 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 min_x = 100 * 100 * 100 + 1 min_x 100 * 100 * 100 + 1 100 * 100 * 100 100 * 100 100 100 100 1 for p in range(1, 100+1, 1):
  total = 0
  for xi in x:
    total += (xi - p) ** 2

  min_x = min([min_x, total]) p range(1, 100+1, 1) range 1 100+1 100 1 1 total = 0 total 0 for xi in x:
    total += (xi - p) ** 2

   xi x total += (xi - p) ** 2 total (xi - p) ** 2 xi - p xi p 2 min_x = min([min_x, total]) min_x min([min_x, total]) min [min_x, total] min_x total print(min_x) print min_x min_x = 100 * 100 * 100 + 1 100 * 100 * 100 + 1 min_x x = list(map(int, input().split())) list(map(int, input().split())) x min_x = min([min_x, total]) min([min_x, total]) min_x total += (xi - p) ** 2 (xi - p) ** 2 total n = int(input()) int(input()) n total = 0 0 total
n = int(input())
x = list(map(int, input().split()))

min_x = 100 * 100 * 100 + 1
for p in range(1, 100+1, 1):
  total = 0
  for xi in x:
    total += (xi - p) ** 2

  min_x = min([min_x, total])

print(min_x)

