n = int(input())
x = list(map(int,input().split()))
ans = 100**2 * n

for i in range(1,101):
    energy = 0
    for j in x:
        energy += (i-j)**2
    ans = min(ans, energy)

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

for i in range(1,101):
    energy = 0
    for j in x:
        energy += (i-j)**2
    ans = min(ans, energy)

print(ans)