from decimal import Decimal, ROUND_HALF_UP

n = int(input())
x = list(map(int,input().split()))
a = Decimal(sum(x) / n).quantize(Decimal('0'), rounding=ROUND_HALF_UP)
ans = 0

for i in range(n):
    ans += (x[i] - a) ** 2

print(ans) from decimal import Decimal, ROUND_HALF_UP 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 a = Decimal(sum(x) / n).quantize(Decimal('0'), rounding=ROUND_HALF_UP) a Decimal(sum(x) / n).quantize(Decimal('0'), rounding=ROUND_HALF_UP) (sum(x) / n).quantize (sum(x) / n) Decimal sum(x) / n sum(x) sum x n quantize Decimal('0') Decimal '0' rounding=ROUND_HALF_UP rounding ROUND_HALF_UP ans = 0 ans 0 for i in range(n):
    ans += (x[i] - a) ** 2 i range(n) range n ans += (x[i] - a) ** 2 ans (x[i] - a) ** 2 x[i] - a x[i] x i a 2 print(ans) print ans a = Decimal(sum(x) / n).quantize(Decimal('0'), rounding=ROUND_HALF_UP) Decimal(sum(x) / n).quantize(Decimal('0'), rounding=ROUND_HALF_UP) a n = int(input()) int(input()) n ans += (x[i] - a) ** 2 (x[i] - a) ** 2 ans x = list(map(int,input().split())) list(map(int,input().split())) x ans = 0 0 ans
from decimal import Decimal, ROUND_HALF_UP

n = int(input())
x = list(map(int,input().split()))
a = Decimal(sum(x) / n).quantize(Decimal('0'), rounding=ROUND_HALF_UP)
ans = 0

for i in range(n):
    ans += (x[i] - a) ** 2

print(ans)