N = int(input())
pd = [0]*100
*X, = map(int,(input().split()))
for i in range(100):
    x_sum = 0
    for j in X:    
        y = (j-i)**2
        x_sum += y
    pd[i-1] = x_sum
print(min(pd)) N = int(input()) N int(input()) int input() input pd = [0]*100 pd [0]*100 [0] 0 100 *X, = map(int,(input().split())) *X X map(int,(input().split())) map int input().split() ().split () input split for i in range(100):
    x_sum = 0
    for j in X:    
        y = (j-i)**2
        x_sum += y
    pd[i-1] = x_sum i range(100) range 100 x_sum = 0 x_sum 0 for j in X:    
        y = (j-i)**2
        x_sum += y
     j X y = (j-i)**2 y (j-i)**2 j-i j i 2 x_sum += y x_sum y pd[i-1] = x_sum pd[i-1] pd i-1 i 1 x_sum print(min(pd)) print min(pd) min pd N = int(input()) int(input()) N x_sum += y y x_sum pd = [0]*100 [0]*100 pd x_sum = 0 0 x_sum y = (j-i)**2 (j-i)**2 y
N = int(input())
pd = [0]*100
*X, = map(int,(input().split()))
for i in range(100):
    x_sum = 0
    for j in X:    
        y = (j-i)**2
        x_sum += y
    pd[i-1] = x_sum
print(min(pd))