n = int(input())
x = list(map(int, input().split()))
sum1 = 100*100**2
for i in range(101):
    sum2 = 0
    for j in range(len(x)):
        sum2 += (x[j] - i)**2
    if sum2 < sum1:
        sum1 = sum2
print(sum1) 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 sum1 = 100*100**2 sum1 100*100**2 100 100**2 100 2 for i in range(101):
    sum2 = 0
    for j in range(len(x)):
        sum2 += (x[j] - i)**2
    if sum2 < sum1:
        sum1 = sum2 i range(101) range 101 sum2 = 0 sum2 0 for j in range(len(x)):
        sum2 += (x[j] - i)**2
     j range(len(x)) range len(x) len x sum2 += (x[j] - i)**2 sum2 (x[j] - i)**2 x[j] - i x[j] x j i 2 if sum2 < sum1:
        sum1 = sum2 sum2 < sum1 sum2 sum1 sum1 = sum2 sum1 sum2 print(sum1) print sum1 sum2 = 0 0 sum2 sum2 += (x[j] - i)**2 (x[j] - i)**2 sum2 sum1 = 100*100**2 100*100**2 sum1 sum1 = sum2 sum2 sum1 n = int(input()) int(input()) n x = list(map(int, input().split())) list(map(int, input().split())) x
n = int(input())
x = list(map(int, input().split()))
sum1 = 100*100**2
for i in range(101):
    sum2 = 0
    for j in range(len(x)):
        sum2 += (x[j] - i)**2
    if sum2 < sum1:
        sum1 = sum2
print(sum1)