N = int(input())
Xs = list(map(int, input().split()))

ans = 10**10
for P in range(0, 102):
    cost = 0
    for X in Xs:
        cost += (X-P)**2
    ans = min(ans, cost)

print(ans) N = int(input()) N int(input()) int input() input Xs = list(map(int, input().split())) Xs list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = 10**10 ans 10**10 10 10 for P in range(0, 102):
    cost = 0
    for X in Xs:
        cost += (X-P)**2
    ans = min(ans, cost) P range(0, 102) range 0 102 cost = 0 cost 0 for X in Xs:
        cost += (X-P)**2
     X Xs cost += (X-P)**2 cost (X-P)**2 X-P X P 2 ans = min(ans, cost) ans min(ans, cost) min ans cost print(ans) print ans N = int(input()) int(input()) N ans = min(ans, cost) min(ans, cost) ans Xs = list(map(int, input().split())) list(map(int, input().split())) Xs cost = 0 0 cost cost += (X-P)**2 (X-P)**2 cost ans = 10**10 10**10 ans
N = int(input())
Xs = list(map(int, input().split()))

ans = 10**10
for P in range(0, 102):
    cost = 0
    for X in Xs:
        cost += (X-P)**2
    ans = min(ans, cost)

print(ans)
