n = int(input())
x = list(map(int, input().split()))
sum_energy_list = []

for p in range(1, 100):
    sum_energy = 0
    for i in range(len(x)):
        sum_energy += (x[i] - p) ** 2
    sum_energy_list.append(sum_energy)

answer = min(sum_energy_list)

print(answer) 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 sum_energy_list = [] sum_energy_list [] for p in range(1, 100):
    sum_energy = 0
    for i in range(len(x)):
        sum_energy += (x[i] - p) ** 2
    sum_energy_list.append(sum_energy) p range(1, 100) range 1 100 sum_energy = 0 sum_energy 0 for i in range(len(x)):
        sum_energy += (x[i] - p) ** 2
     i range(len(x)) range len(x) len x sum_energy += (x[i] - p) ** 2 sum_energy (x[i] - p) ** 2 x[i] - p x[i] x i p 2 sum_energy_list.append(sum_energy) sum_energy_list.append sum_energy_list append sum_energy answer = min(sum_energy_list) answer min(sum_energy_list) min sum_energy_list print(answer) print answer x = list(map(int, input().split())) list(map(int, input().split())) x sum_energy = 0 0 sum_energy sum_energy += (x[i] - p) ** 2 (x[i] - p) ** 2 sum_energy answer = min(sum_energy_list) min(sum_energy_list) answer n = int(input()) int(input()) n sum_energy_list = [] [] sum_energy_list
n = int(input())
x = list(map(int, input().split()))
sum_energy_list = []

for p in range(1, 100):
    sum_energy = 0
    for i in range(len(x)):
        sum_energy += (x[i] - p) ** 2
    sum_energy_list.append(sum_energy)

answer = min(sum_energy_list)

print(answer)
