N=int(input())
X=list(map(int, input().split()))
ans=[0]*100

for i in range(100):
	P=i+1
	a=0
	for x in X:
		a+=(x-P)**2
	ans[i]=a

print(min(ans)) 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 ans=[0]*100 ans [0]*100 [0] 0 100 for i in range(100):
	P=i+1
	a=0
	for x in X:
		a+=(x-P)**2
	ans[i]=a i range(100) range 100 P=i+1 P i+1 i 1 a=0 a 0 for x in X:
		a+=(x-P)**2
	 x X a+=(x-P)**2 a (x-P)**2 x-P x P 2 ans[i]=a ans[i] ans i a print(min(ans)) print min(ans) min ans a=0 0 a X=list(map(int, input().split())) list(map(int, input().split())) X ans=[0]*100 [0]*100 ans N=int(input()) int(input()) N a+=(x-P)**2 (x-P)**2 a P=i+1 i+1 P
N=int(input())
X=list(map(int, input().split()))
ans=[0]*100

for i in range(100):
	P=i+1
	a=0
	for x in X:
		a+=(x-P)**2
	ans[i]=a

print(min(ans))