N = int(input())
X = list(map(int, input().split()))
average = round(sum(X) / len(X))
health = 0
for x in X:
    health += (average - x)** 2
print(health) 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 average = round(sum(X) / len(X)) average round(sum(X) / len(X)) round sum(X) / len(X) sum(X) sum X len(X) len X health = 0 health 0 for x in X:
    health += (average - x)** 2 x X health += (average - x)** 2 health (average - x)** 2 average - x average x 2 print(health) print health X = list(map(int, input().split())) list(map(int, input().split())) X average = round(sum(X) / len(X)) round(sum(X) / len(X)) average N = int(input()) int(input()) N health += (average - x)** 2 (average - x)** 2 health health = 0 0 health
N = int(input())
X = list(map(int, input().split()))
average = round(sum(X) / len(X))
health = 0
for x in X:
    health += (average - x)** 2
print(health)