n = int(input())
x = list(map(int, input().split()))
ans = []
for i in range(1, 101):
    tmp = 0
    for j in range(n):
        tmp += pow(x[j]-i, 2)
    ans.append(tmp)
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 i in range(1, 101):
    tmp = 0
    for j in range(n):
        tmp += pow(x[j]-i, 2)
    ans.append(tmp) i range(1, 101) range 1 101 tmp = 0 tmp 0 for j in range(n):
        tmp += pow(x[j]-i, 2)
     j range(n) range n tmp += pow(x[j]-i, 2) tmp pow(x[j]-i, 2) pow x[j]-i x[j] x j i 2 ans.append(tmp) ans.append ans append tmp print(min(ans)) print min(ans) min ans tmp = 0 0 tmp x = list(map(int, input().split())) list(map(int, input().split())) x tmp += pow(x[j]-i, 2) pow(x[j]-i, 2) tmp ans = [] [] ans n = int(input()) int(input()) n
n = int(input())
x = list(map(int, input().split()))
ans = []
for i in range(1, 101):
    tmp = 0
    for j in range(n):
        tmp += pow(x[j]-i, 2)
    ans.append(tmp)
print(min(ans))