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

INF = 10**6 + 1
mintotal = INF
for p in range(1, 101):
    total = 0
    for x in X:
        total += (x-p)**2
    mintotal = min(mintotal, total)
print(mintotal) 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 INF = 10**6 + 1 INF 10**6 + 1 10**6 10 6 1 mintotal = INF mintotal INF for p in range(1, 101):
    total = 0
    for x in X:
        total += (x-p)**2
    mintotal = min(mintotal, total) p range(1, 101) range 1 101 total = 0 total 0 for x in X:
        total += (x-p)**2
     x X total += (x-p)**2 total (x-p)**2 x-p x p 2 mintotal = min(mintotal, total) mintotal min(mintotal, total) min mintotal total print(mintotal) print mintotal mintotal = INF INF mintotal total = 0 0 total N = int(input()) int(input()) N mintotal = min(mintotal, total) min(mintotal, total) mintotal X = list(map(int, input().split())) list(map(int, input().split())) X INF = 10**6 + 1 10**6 + 1 INF total += (x-p)**2 (x-p)**2 total
N = int(input())
X = list(map(int, input().split()))

INF = 10**6 + 1
mintotal = INF
for p in range(1, 101):
    total = 0
    for x in X:
        total += (x-p)**2
    mintotal = min(mintotal, total)
print(mintotal)