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

ans = 1000000000

for i in range(1, max(X)+1):
    l = 0
    for j in range(N):
        l += (i - X[j]) ** 2
    ans = min(ans, l)

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 = 1000000000 ans 1000000000 for i in range(1, max(X)+1):
    l = 0
    for j in range(N):
        l += (i - X[j]) ** 2
    ans = min(ans, l) i range(1, max(X)+1) range 1 max(X)+1 max(X) max X 1 l = 0 l 0 for j in range(N):
        l += (i - X[j]) ** 2
     j range(N) range N l += (i - X[j]) ** 2 l (i - X[j]) ** 2 i - X[j] i X[j] X j 2 ans = min(ans, l) ans min(ans, l) min ans l print(ans) print ans N = int(input()) int(input()) N ans = min(ans, l) min(ans, l) ans l += (i - X[j]) ** 2 (i - X[j]) ** 2 l l = 0 0 l X = list(map(int, input().split())) list(map(int, input().split())) X ans = 1000000000 1000000000 ans
N = int(input())
X = list(map(int, input().split()))

ans = 1000000000

for i in range(1, max(X)+1):
    l = 0
    for j in range(N):
        l += (i - X[j]) ** 2
    ans = min(ans, l)

print(ans)