import os, sys, re, math

N = int(input())
X = [int(n) for n in input().split()]

d = [i ** 2 for i in range(101)]

min_v = 100 ** 2 * 100
for i in range(1, 101):
    min_v = min(min_v, sum(d[abs(x - i)] for x in X))

print(min_v) import os, sys, re, math os sys re math N = int(input()) N int(input()) int input() input int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n X = [int(n) for n in input().split()] X [int(n) for n in input().split()] i ** 2 for i in range(101) for i in range(101) i range(101) range 101 for i in range(101) i ** 2 i 2 d = [i ** 2 for i in range(101)] d [i ** 2 for i in range(101)] min_v = 100 ** 2 * 100 min_v 100 ** 2 * 100 100 ** 2 100 2 100 for i in range(1, 101):
    min_v = min(min_v, sum(d[abs(x - i)] for x in X)) i range(1, 101) range 1 101 min_v = min(min_v, sum(d[abs(x - i)] for x in X)) min_v min(min_v, sum(d[abs(x - i)] for x in X)) min min_v sum(d[abs(x - i)] for x in X) sum d[abs(x - i)] d abs(x - i) abs x - i x i print(min_v) print min_v min_v = min(min_v, sum(d[abs(x - i)] for x in X)) min(min_v, sum(d[abs(x - i)] for x in X)) min_v min_v = 100 ** 2 * 100 100 ** 2 * 100 min_v X = [int(n) for n in input().split()] [int(n) for n in input().split()] X N = int(input()) int(input()) N d = [i ** 2 for i in range(101)] [i ** 2 for i in range(101)] d
import os, sys, re, math

N = int(input())
X = [int(n) for n in input().split()]

d = [i ** 2 for i in range(101)]

min_v = 100 ** 2 * 100
for i in range(1, 101):
    min_v = min(min_v, sum(d[abs(x - i)] for x in X))

print(min_v)
