#C
N=int(input())
X=list(map(int,input().split()))

P=round(sum(X)/N,0)
vital_sum=0
for i in X:
    vital_sum+=(i-P)**2
print(int(vital_sum)) 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=round(sum(X)/N,0) P round(sum(X)/N,0) round sum(X)/N sum(X) sum X N 0 vital_sum=0 vital_sum 0 for i in X:
    vital_sum+=(i-P)**2 i X vital_sum+=(i-P)**2 vital_sum (i-P)**2 i-P i P 2 print(int(vital_sum)) print int(vital_sum) int vital_sum vital_sum=0 0 vital_sum N=int(input()) int(input()) N X=list(map(int,input().split())) list(map(int,input().split())) X P=round(sum(X)/N,0) round(sum(X)/N,0) P vital_sum+=(i-P)**2 (i-P)**2 vital_sum
#C
N=int(input())
X=list(map(int,input().split()))

P=round(sum(X)/N,0)
vital_sum=0
for i in X:
    vital_sum+=(i-P)**2
print(int(vital_sum))