from numpy import average
from decimal import Decimal, ROUND_HALF_UP
 
n=int(input())
x=list(map(int,input().split()))
 
p=Decimal(str(average(x))).quantize(Decimal('1'),rounding=ROUND_HALF_UP)
 
ans=0
for i in x:
	ans+=((i-p)**2)

print(ans) from numpy import average 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 p=Decimal(str(average(x))).quantize(Decimal('1'),rounding=ROUND_HALF_UP) p Decimal(str(average(x))).quantize(Decimal('1'),rounding=ROUND_HALF_UP) (str(average(x))).quantize (str(average(x))) Decimal str(average(x)) str average(x) average x quantize Decimal('1') Decimal '1' rounding=ROUND_HALF_UP rounding ROUND_HALF_UP ans=0 ans 0 for i in x:
	ans+=((i-p)**2) i x ans+=((i-p)**2) ans (i-p)**2 i-p i p 2 print(ans) print ans p=Decimal(str(average(x))).quantize(Decimal('1'),rounding=ROUND_HALF_UP) Decimal(str(average(x))).quantize(Decimal('1'),rounding=ROUND_HALF_UP) p ans+=((i-p)**2) (i-p)**2 ans x=list(map(int,input().split())) list(map(int,input().split())) x n=int(input()) int(input()) n ans=0 0 ans
from numpy import average
from decimal import Decimal, ROUND_HALF_UP
 
n=int(input())
x=list(map(int,input().split()))
 
p=Decimal(str(average(x))).quantize(Decimal('1'),rounding=ROUND_HALF_UP)
 
ans=0
for i in x:
	ans+=((i-p)**2)

print(ans)