N = int(input())
nums = list(map(int, input().split()))
answer = 10**8
for p in range(1, 100):
  power = 0
  for j in range(N):
    power += (p-nums[j])**2
  answer = min(answer, power)
print(answer) N = int(input()) N int(input()) int input() input nums = list(map(int, input().split())) nums list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split answer = 10**8 answer 10**8 10 8 for p in range(1, 100):
  power = 0
  for j in range(N):
    power += (p-nums[j])**2
  answer = min(answer, power) p range(1, 100) range 1 100 power = 0 power 0 for j in range(N):
    power += (p-nums[j])**2
   j range(N) range N power += (p-nums[j])**2 power (p-nums[j])**2 p-nums[j] p nums[j] nums j 2 answer = min(answer, power) answer min(answer, power) min answer power print(answer) print answer answer = min(answer, power) min(answer, power) answer N = int(input()) int(input()) N power = 0 0 power power += (p-nums[j])**2 (p-nums[j])**2 power nums = list(map(int, input().split())) list(map(int, input().split())) nums answer = 10**8 10**8 answer
N = int(input())
nums = list(map(int, input().split()))
answer = 10**8
for p in range(1, 100):
  power = 0
  for j in range(N):
    power += (p-nums[j])**2
  answer = min(answer, power)
print(answer)