import numpy as np 

n = int(eval(input()))

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

x = np.array(x)

ans = float('inf')

idx = 200

for i in range(100):

  y = x 

  ans = min(ans, np.sum((y-i)**2))

  

print(ans)
N = int(eval(input()))

X = list(map(int, input().split()))

mx = max(X)

ans = float('inf')

for i in range(mx+1):

  tmp = 0

  for x in X:

    tmp += (x-(i+1))**2

  ans = min(ans, tmp)

print(ans)
import numpy as np

n = int(eval(input()))
x = list(map(int, input().split()))
x = np.array(x)
ans = float("inf")
idx = 200
for i in range(100):
    y = x
    ans = min(ans, np.sum((y - i) ** 2))
print(ans)

N = int(eval(input()))
X = list(map(int, input().split()))
mx = max(X)
ans = float("inf")
for i in range(mx + 1):
    tmp = 0
    for x in X:
        tmp += (x - (i + 1)) ** 2
    ans = min(ans, tmp)
print(ans)

-import numpy as np - -n = int(eval(input())) -x = list(map(int, input().split())) -x = np.array(x) +N = int(eval(input())) +X = list(map(int, input().split())) +mx = max(X) -idx = 200 -for i in range(100): -    y = x -    ans = min(ans, np.sum((y - i) ** 2)) +for i in range(mx + 1): +    tmp = 0 +    for x in X: +        tmp += (x - (i + 1)) ** 2 +    ans = min(ans, tmp)