@staticmethod
def c():
    (n, *a) = map(int, sys.stdin.read().split())
    a = np.array(a)
    x = np.around((a.sum() / n)).astype(int)
    print(np.sum(((a - x) ** 2)))
@staticmethod
def c():
    (n, *a) = map(int, sys.stdin.read().split())
    a = np.array(a)
    x = np.around((a.sum() / n)).astype(int)
    print(np.sum(((a - x) ** 2)))