import numpy as np
 
N = input()
X = list(map(int, input().split()))
ans=9999999
for P in range(0, 101):
  sum = np.sum(list(map(lambda x: (x-P)**2, X)))
  ans = min(ans, sum)
    
print(ans) import numpy as np numpy N = input() N 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=9999999 ans 9999999 for P in range(0, 101):
  sum = np.sum(list(map(lambda x: (x-P)**2, X)))
  ans = min(ans, sum)
     P range(0, 101) range 0 101 sum = np.sum(list(map(lambda x: (x-P)**2, X))) sum np.sum(list(map(lambda x: (x-P)**2, X))) np.sum np sum list(map(lambda x: (x-P)**2, X)) list map(lambda x: (x-P)**2, X) map lambda x: (x-P)**2 (x-P)**2 x-P x P 2 x X ans = min(ans, sum) ans min(ans, sum) min ans sum print(ans) print ans X = list(map(int, input().split())) list(map(int, input().split())) X ans = min(ans, sum) min(ans, sum) ans ans=9999999 9999999 ans N = input() input() N sum = np.sum(list(map(lambda x: (x-P)**2, X))) np.sum(list(map(lambda x: (x-P)**2, X))) sum
import numpy as np
 
N = input()
X = list(map(int, input().split()))
ans=9999999
for P in range(0, 101):
  sum = np.sum(list(map(lambda x: (x-P)**2, X)))
  ans = min(ans, sum)
    
print(ans)