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

ans = float("inf")
for p in range(1,101):
    hp = 0
    for i in x:
        hp += (i-p)**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 ans = float("inf") ans float("inf") float "inf" for p in range(1,101):
    hp = 0
    for i in x:
        hp += (i-p)**2
    ans = min(ans, hp) p range(1,101) range 1 101 hp = 0 hp 0 for i in x:
        hp += (i-p)**2
     i x hp += (i-p)**2 hp (i-p)**2 i-p i p 2 ans = min(ans, hp) ans min(ans, hp) min ans hp print(ans) print ans hp = 0 0 hp hp += (i-p)**2 (i-p)**2 hp ans = min(ans, hp) min(ans, hp) ans ans = float("inf") float("inf") ans 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()))

ans = float("inf")
for p in range(1,101):
    hp = 0
    for i in x:
        hp += (i-p)**2
    ans = min(ans, hp)
print(ans)