N = int(input())
X = list(map(int,input().split()))
ans = 10**36
S = 0

for p in range(100):
    S =0
    for x in X:
        S += (x-p)**2
    ans = min(ans,S)

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

for p in range(100):
    S =0
    for x in X:
        S += (x-p)**2
    ans = min(ans,S)

print(ans)