n = int(input())
x = input().split()

min = 2**50

for p in range(100):
    min_i = 0
    if p in x:
        continue
    for i in x:
        min_i = min_i + (int(i) - p)**2
    if min_i <= min:
        min = min_i
print(min) n = int(input()) n int(input()) int input() input x = input().split() x input().split() ().split () input split min = 2**50 min 2**50 2 50 for p in range(100):
    min_i = 0
    if p in x:
        continue
    for i in x:
        min_i = min_i + (int(i) - p)**2
    if min_i <= min:
        min = min_i p range(100) range 100 min_i = 0 min_i 0 if p in x:
        continue
     p in x p x continue for i in x:
        min_i = min_i + (int(i) - p)**2
     i x min_i = min_i + (int(i) - p)**2 min_i min_i + (int(i) - p)**2 min_i (int(i) - p)**2 int(i) - p int(i) int i p 2 if min_i <= min:
        min = min_i min_i <= min min_i min min = min_i min min_i print(min) print min min = 2**50 2**50 min x = input().split() input().split() x min = min_i min_i min n = int(input()) int(input()) n min_i = 0 0 min_i min_i = min_i + (int(i) - p)**2 min_i + (int(i) - p)**2 min_i
n = int(input())
x = input().split()

min = 2**50

for p in range(100):
    min_i = 0
    if p in x:
        continue
    for i in x:
        min_i = min_i + (int(i) - p)**2
    if min_i <= min:
        min = min_i
print(min)