n = int(input())
x =  list(map(int,input().split()))

x.sort()

ans = 1000000000

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

x.sort()

ans = 1000000000

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