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

ans = []
for p in range(100+1):
    phys = 0
    for x in X:
        phys += (x-p)**2
    ans.append(phys)

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

ans = []
for p in range(100+1):
    phys = 0
    for x in X:
        phys += (x-p)**2
    ans.append(phys)

print(min(ans))
