N = int(input())
X = list(map(int, input().split()))
SUM = 0
DIF = 0
for i in range(N):
    SUM = SUM + X[i]

AVG = round((SUM / N))



for i in range(N):
    DIF = DIF + (abs(X[i] - AVG))**2
print(DIF) N = int(input()) N int(input()) int input() input X = list(map(int, input().split())) X list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split SUM = 0 SUM 0 DIF = 0 DIF 0 for i in range(N):
    SUM = SUM + X[i] i range(N) range N SUM = SUM + X[i] SUM SUM + X[i] SUM X[i] X i AVG = round((SUM / N)) AVG round((SUM / N)) round SUM / N SUM N for i in range(N):
    DIF = DIF + (abs(X[i] - AVG))**2 i range(N) range N DIF = DIF + (abs(X[i] - AVG))**2 DIF DIF + (abs(X[i] - AVG))**2 DIF (abs(X[i] - AVG))**2 abs(X[i] - AVG) abs X[i] - AVG X[i] X i AVG 2 print(DIF) print DIF AVG = round((SUM / N)) round((SUM / N)) AVG DIF = DIF + (abs(X[i] - AVG))**2 DIF + (abs(X[i] - AVG))**2 DIF SUM = 0 0 SUM X = list(map(int, input().split())) list(map(int, input().split())) X N = int(input()) int(input()) N SUM = SUM + X[i] SUM + X[i] SUM DIF = 0 0 DIF
N = int(input())
X = list(map(int, input().split()))
SUM = 0
DIF = 0
for i in range(N):
    SUM = SUM + X[i]

AVG = round((SUM / N))



for i in range(N):
    DIF = DIF + (abs(X[i] - AVG))**2
print(DIF)