import numpy as np

n = int(eval(input()))

a = np.array(list(map(int, input().split())))

b = round(sum(a) / n)

m = int(sum((a - b) ** 2))

print(m)
n = int(eval(input()))

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

b = round(sum(a) / n)

m = sum([(x - b) ** 2 for x in a])

print(m)
import numpy as np

n = int(eval(input()))
a = np.array(list(map(int, input().split())))
b = round(sum(a) / n)
m = int(sum((a - b) ** 2))
print(m)

n = int(eval(input()))
a = list(map(int, input().split()))
b = round(sum(a) / n)
m = sum([(x - b) ** 2 for x in a])
print(m)

-import numpy as np - -a = np.array(list(map(int, input().split()))) +a = list(map(int, input().split())) -m = int(sum((a - b) ** 2)) +m = sum([(x - b) ** 2 for x in a])