n = int(input())
x = list(map(int, input().split()))
ans = 2000000000
for i in range(1,101):
  sum = 0
  for j in x:
    sum += (i-j)**2
  ans = min(sum, ans)
print(ans) 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 ans = 2000000000 ans 2000000000 for i in range(1,101):
  sum = 0
  for j in x:
    sum += (i-j)**2
  ans = min(sum, ans) i range(1,101) range 1 101 sum = 0 sum 0 for j in x:
    sum += (i-j)**2
   j x sum += (i-j)**2 sum (i-j)**2 i-j i j 2 ans = min(sum, ans) ans min(sum, ans) min sum ans print(ans) print ans x = list(map(int, input().split())) list(map(int, input().split())) x ans = 2000000000 2000000000 ans ans = min(sum, ans) min(sum, ans) ans sum = 0 0 sum n = int(input()) int(input()) n sum += (i-j)**2 (i-j)**2 sum
n = int(input())
x = list(map(int, input().split()))
ans = 2000000000
for i in range(1,101):
  sum = 0
  for j in x:
    sum += (i-j)**2
  ans = min(sum, ans)
print(ans)