n = int(input())
xi = list(map(int,input().split()))
tairyoku = []
for p in range(100):
  tmp = 0
  for x in xi:
    tmp += (p+1-x)**2
  tairyoku.append(tmp)
print(min(tairyoku)) n = int(input()) n int(input()) int input() input xi = list(map(int,input().split())) xi list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split tairyoku = [] tairyoku [] for p in range(100):
  tmp = 0
  for x in xi:
    tmp += (p+1-x)**2
  tairyoku.append(tmp) p range(100) range 100 tmp = 0 tmp 0 for x in xi:
    tmp += (p+1-x)**2
   x xi tmp += (p+1-x)**2 tmp (p+1-x)**2 p+1-x p+1 p 1 x 2 tairyoku.append(tmp) tairyoku.append tairyoku append tmp print(min(tairyoku)) print min(tairyoku) min tairyoku xi = list(map(int,input().split())) list(map(int,input().split())) xi tmp = 0 0 tmp n = int(input()) int(input()) n tmp += (p+1-x)**2 (p+1-x)**2 tmp tairyoku = [] [] tairyoku
n = int(input())
xi = list(map(int,input().split()))
tairyoku = []
for p in range(100):
  tmp = 0
  for x in xi:
    tmp += (p+1-x)**2
  tairyoku.append(tmp)
print(min(tairyoku))
