N = int(input())
X = list(map(int, input().split()))
ans = 50 ** 2 * 100
for P in range(1,101):
    sum = 0
    for i in range(N):
        sum += (X[i] - P) ** 2
    if sum < ans:
        ans = sum
print(ans) 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 ans = 50 ** 2 * 100 ans 50 ** 2 * 100 50 ** 2 50 2 100 for P in range(1,101):
    sum = 0
    for i in range(N):
        sum += (X[i] - P) ** 2
    if sum < ans:
        ans = sum P range(1,101) range 1 101 sum = 0 sum 0 for i in range(N):
        sum += (X[i] - P) ** 2
     i range(N) range N sum += (X[i] - P) ** 2 sum (X[i] - P) ** 2 X[i] - P X[i] X i P 2 if sum < ans:
        ans = sum sum < ans sum ans ans = sum ans sum print(ans) print ans ans = sum sum ans N = int(input()) int(input()) N X = list(map(int, input().split())) list(map(int, input().split())) X sum += (X[i] - P) ** 2 (X[i] - P) ** 2 sum ans = 50 ** 2 * 100 50 ** 2 * 100 ans sum = 0 0 sum
N = int(input())
X = list(map(int, input().split()))
ans = 50 ** 2 * 100
for P in range(1,101):
    sum = 0
    for i in range(N):
        sum += (X[i] - P) ** 2
    if sum < ans:
        ans = sum
print(ans)
