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

dp=[0 for i in range(100)]
i=1
for j in range(N):
    dp[0]+=(X[j]-0)**2

while True:
    for j in range(N):
        dp[i]+=(X[j]-i)**2
    if dp[i]>=dp[i-1]:
        break
    i+=1

ans=dp[i-1]
print(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 0 for i in range(100) for i in range(100) i range(100) range 100 for i in range(100) 0 dp=[0 for i in range(100)] dp [0 for i in range(100)] i=1 i 1 for j in range(N):
    dp[0]+=(X[j]-0)**2 j range(N) range N dp[0]+=(X[j]-0)**2 dp[0] dp 0 (X[j]-0)**2 X[j]-0 X[j] X j 0 2 while True:
    for j in range(N):
        dp[i]+=(X[j]-i)**2
    if dp[i]>=dp[i-1]:
        break
    i+=1 True for j in range(N):
        dp[i]+=(X[j]-i)**2
     j range(N) range N dp[i]+=(X[j]-i)**2 dp[i] dp i (X[j]-i)**2 X[j]-i X[j] X j i 2 if dp[i]>=dp[i-1]:
        break
     dp[i]>=dp[i-1] dp[i] dp i dp[i-1] dp i-1 i 1 break i+=1 i 1 ans=dp[i-1] ans dp[i-1] dp i-1 i 1 print(ans) print ans dp=[0 for i in range(100)] [0 for i in range(100)] dp i+=1 1 i N=int(input()) int(input()) N X=list(map(int,input().split())) list(map(int,input().split())) X ans=dp[i-1] dp[i-1] ans i=1 1 i
N=int(input())
X=list(map(int,input().split()))

dp=[0 for i in range(100)]
i=1
for j in range(N):
    dp[0]+=(X[j]-0)**2

while True:
    for j in range(N):
        dp[i]+=(X[j]-i)**2
    if dp[i]>=dp[i-1]:
        break
    i+=1

ans=dp[i-1]
print(ans)