n = int(input())
a = list(map(int, input().split()))
ans = 10**9
for i in range(0, 101):
  temp = 0
  for x in a:
    temp += (x-i)**2
  ans = min(ans, temp)
print(ans) n = int(input()) n int(input()) int input() input a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = 10**9 ans 10**9 10 9 for i in range(0, 101):
  temp = 0
  for x in a:
    temp += (x-i)**2
  ans = min(ans, temp) i range(0, 101) range 0 101 temp = 0 temp 0 for x in a:
    temp += (x-i)**2
   x a temp += (x-i)**2 temp (x-i)**2 x-i x i 2 ans = min(ans, temp) ans min(ans, temp) min ans temp print(ans) print ans temp += (x-i)**2 (x-i)**2 temp temp = 0 0 temp ans = 10**9 10**9 ans n = int(input()) int(input()) n a = list(map(int, input().split())) list(map(int, input().split())) a ans = min(ans, temp) min(ans, temp) ans
n = int(input())
a = list(map(int, input().split()))
ans = 10**9
for i in range(0, 101):
  temp = 0
  for x in a:
    temp += (x-i)**2
  ans = min(ans, temp)
print(ans)
