n=int(input())
x=list(map(int,input().split()))

ans=n * 100**2
for p in range(101):
    ans=min(ans,sum([(xi-p)**2 for xi in x]))
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 ans=n * 100**2 ans n * 100**2 n 100**2 100 2 for p in range(101):
    ans=min(ans,sum([(xi-p)**2 for xi in x])) p range(101) range 101 (xi-p)**2 for xi in x for xi in x xi x for xi in x (xi-p)**2 xi-p xi p 2 ans=min(ans,sum([(xi-p)**2 for xi in x])) ans min(ans,sum([(xi-p)**2 for xi in x])) min ans sum([(xi-p)**2 for xi in x]) sum [(xi-p)**2 for xi in x] print(ans) print ans ans=n * 100**2 n * 100**2 ans n=int(input()) int(input()) n x=list(map(int,input().split())) list(map(int,input().split())) x ans=min(ans,sum([(xi-p)**2 for xi in x])) min(ans,sum([(xi-p)**2 for xi in x])) ans
n=int(input())
x=list(map(int,input().split()))

ans=n * 100**2
for p in range(101):
    ans=min(ans,sum([(xi-p)**2 for xi in x]))
print(ans)
