N = int(input())
X = input().split()

distance = 0
min_distance = float('Inf')

for i in range(1,101):
    for j in range(N):
        distance += (int(X[j]) - i) ** 2

    min_distance = min(min_distance, distance)
    distance = 0

print(min_distance) N = int(input()) N int(input()) int input() input X = input().split() X input().split() ().split () input split distance = 0 distance 0 min_distance = float('Inf') min_distance float('Inf') float 'Inf' for i in range(1,101):
    for j in range(N):
        distance += (int(X[j]) - i) ** 2

    min_distance = min(min_distance, distance)
    distance = 0 i range(1,101) range 1 101 for j in range(N):
        distance += (int(X[j]) - i) ** 2

     j range(N) range N distance += (int(X[j]) - i) ** 2 distance (int(X[j]) - i) ** 2 int(X[j]) - i int(X[j]) int X[j] X j i 2 min_distance = min(min_distance, distance) min_distance min(min_distance, distance) min min_distance distance distance = 0 distance 0 print(min_distance) print min_distance min_distance = min(min_distance, distance) min(min_distance, distance) min_distance min_distance = float('Inf') float('Inf') min_distance X = input().split() input().split() X distance = 0 0 distance N = int(input()) int(input()) N distance = 0 0 distance distance += (int(X[j]) - i) ** 2 (int(X[j]) - i) ** 2 distance
N = int(input())
X = input().split()

distance = 0
min_distance = float('Inf')

for i in range(1,101):
    for j in range(N):
        distance += (int(X[j]) - i) ** 2

    min_distance = min(min_distance, distance)
    distance = 0

print(min_distance)