N=int(input())
a=0
ans=float('inf')
x=list(map(int,input().split()))
for i in range(100):
    for j in range(N):
        a=a+(x[j]-i-1)**2
    #print(a)
    ans=min(ans,a)
    a=0
print(ans) N=int(input()) N int(input()) int input() input a=0 a 0 ans=float('inf') ans float('inf') float 'inf' x=list(map(int,input().split())) x list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split for i in range(100):
    for j in range(N):
        a=a+(x[j]-i-1)**2
    #print(a)
    ans=min(ans,a)
    a=0 i range(100) range 100 for j in range(N):
        a=a+(x[j]-i-1)**2
    #print(a)
     j range(N) range N a=a+(x[j]-i-1)**2 a a+(x[j]-i-1)**2 a (x[j]-i-1)**2 x[j]-i-1 x[j]-i x[j] x j i 1 2 ans=min(ans,a) ans min(ans,a) min ans a a=0 a 0 print(ans) print ans a=0 0 a a=0 0 a N=int(input()) int(input()) N ans=min(ans,a) min(ans,a) ans ans=float('inf') float('inf') ans x=list(map(int,input().split())) list(map(int,input().split())) x a=a+(x[j]-i-1)**2 a+(x[j]-i-1)**2 a
N=int(input())
a=0
ans=float('inf')
x=list(map(int,input().split()))
for i in range(100):
    for j in range(N):
        a=a+(x[j]-i-1)**2
    #print(a)
    ans=min(ans,a)
    a=0
print(ans)
