N = int(input())
x = []
hp = []
xa = 0
hpsum = 0

x = [int(e) for e in input().split()]
for i in range(N):
    xa += x[i]



xa = xa / N

if xa % 1 < 0.5:
    xa = int(xa / 1)
elif xa % 1 >= 0.5:
    xa = int(xa / 1 + 1)

for j in range(N):
    hp.append((x[j]-xa)*(x[j]-xa))
    hpsum += hp[j]

print(int(hpsum)) N = int(input()) N int(input()) int input() input x = [] x [] hp = [] hp [] xa = 0 xa 0 hpsum = 0 hpsum 0 int(e) for e in input().split() for e in input().split() e input().split() ().split () input split for e in input().split() int(e) int e x = [int(e) for e in input().split()] x [int(e) for e in input().split()] for i in range(N):
    xa += x[i] i range(N) range N xa += x[i] xa x[i] x i xa = xa / N xa xa / N xa N if xa % 1 < 0.5:
    xa = int(xa / 1)
elif xa % 1 >= 0.5:
    xa = int(xa / 1 + 1) xa % 1 < 0.5 xa % 1 xa 1 0.5 xa = int(xa / 1) xa int(xa / 1) int xa / 1 xa 1 elif xa % 1 >= 0.5:
    xa = int(xa / 1 + 1) xa % 1 >= 0.5 xa % 1 xa 1 0.5 xa = int(xa / 1 + 1) xa int(xa / 1 + 1) int xa / 1 + 1 xa / 1 xa 1 1 for j in range(N):
    hp.append((x[j]-xa)*(x[j]-xa))
    hpsum += hp[j] j range(N) range N hp.append((x[j]-xa)*(x[j]-xa)) hp.append hp append (x[j]-xa)*(x[j]-xa) x[j]-xa x[j] x j xa x[j]-xa x[j] x j xa hpsum += hp[j] hpsum hp[j] hp j print(int(hpsum)) print int(hpsum) int hpsum hpsum = 0 0 hpsum xa = int(xa / 1 + 1) int(xa / 1 + 1) xa xa += x[i] x[i] xa N = int(input()) int(input()) N x = [int(e) for e in input().split()] [int(e) for e in input().split()] x xa = 0 0 xa xa = xa / N xa / N xa hpsum += hp[j] hp[j] hpsum hp = [] [] hp xa = int(xa / 1) int(xa / 1) xa x = [] [] x
N = int(input())
x = []
hp = []
xa = 0
hpsum = 0

x = [int(e) for e in input().split()]
for i in range(N):
    xa += x[i]



xa = xa / N

if xa % 1 < 0.5:
    xa = int(xa / 1)
elif xa % 1 >= 0.5:
    xa = int(xa / 1 + 1)

for j in range(N):
    hp.append((x[j]-xa)*(x[j]-xa))
    hpsum += hp[j]

print(int(hpsum))