n = int(input())
x = list(map(int, input().split()))
num = 10**10
for p in range(100):
    cnt = 0
    for i in range(n):
        cnt += (x[i] - p)**2
    num = min(num, cnt)
print(num) 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 num = 10**10 num 10**10 10 10 for p in range(100):
    cnt = 0
    for i in range(n):
        cnt += (x[i] - p)**2
    num = min(num, cnt) p range(100) range 100 cnt = 0 cnt 0 for i in range(n):
        cnt += (x[i] - p)**2
     i range(n) range n cnt += (x[i] - p)**2 cnt (x[i] - p)**2 x[i] - p x[i] x i p 2 num = min(num, cnt) num min(num, cnt) min num cnt print(num) print num num = 10**10 10**10 num n = int(input()) int(input()) n x = list(map(int, input().split())) list(map(int, input().split())) x cnt = 0 0 cnt cnt += (x[i] - p)**2 (x[i] - p)**2 cnt num = min(num, cnt) min(num, cnt) num
n = int(input())
x = list(map(int, input().split()))
num = 10**10
for p in range(100):
    cnt = 0
    for i in range(n):
        cnt += (x[i] - p)**2
    num = min(num, cnt)
print(num)