n,*x=list(map(int,open(0).read().split()))



import numpy as np



xar=np.array(x)



ans=float("inf")

for p in range(0,101):

    tmp=sum((xar-p)**2)

    ans=min(ans,tmp)

    

print((int(ans)))
n,*x=list(map(int,open(0).read().split()))

ans=float("inf")

for p in range(0,101):

  s=0

  for xi in x:

    s+=(xi-p)**2

  ans=min(ans,s)

print((int(ans)))

n, *x = list(map(int, open(0).read().split()))
import numpy as np

xar = np.array(x)
ans = float("inf")
for p in range(0, 101):
    tmp = sum((xar - p) ** 2)
    ans = min(ans, tmp)
print((int(ans)))

n, *x = list(map(int, open(0).read().split()))
ans = float("inf")
for p in range(0, 101):
    s = 0
    for xi in x:
        s += (xi - p) ** 2
    ans = min(ans, s)
print((int(ans)))

-import numpy as np - -xar = np.array(x) -    tmp = sum((xar - p) ** 2) -    ans = min(ans, tmp) +    s = 0 +    for xi in x: +        s += (xi - p) ** 2 +    ans = min(ans, s)