import numpy as np

N = int(eval(input()))

X = np.array(input().split()).astype(int)

P = round(np.average(X))

print((int(np.sum((P-X)**2))))
n = int(eval(input()))

x = [int(i) for i in input().split()]

min_x = round(sum(x) / n)

ans = sum([(min_x - i)**2 for i in x])

print(ans)
import numpy as np

N = int(eval(input()))
X = np.array(input().split()).astype(int)
P = round(np.average(X))
print((int(np.sum((P - X) ** 2))))

n = int(eval(input()))
x = [int(i) for i in input().split()]
min_x = round(sum(x) / n)
ans = sum([(min_x - i) ** 2 for i in x])
print(ans)

-import numpy as np - -N = int(eval(input())) -X = np.array(input().split()).astype(int) -P = round(np.average(X)) -print((int(np.sum((P - X) ** 2)))) +n = int(eval(input())) +x = [int(i) for i in input().split()] +min_x = round(sum(x) / n) +ans = sum([(min_x - i) ** 2 for i in x]) +print(ans)