N = int(input())
X = list(map(int, input().split()))
_min = min(X)
_max = max(X)
_sum = 1000000000
for i in range(_min, _max+1):
    temp = 0
    for x in X:
        temp += (x - i) * (x - i)
    if temp < _sum:
        _sum = temp
print(_sum) 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 _min = min(X) _min min(X) min X _max = max(X) _max max(X) max X _sum = 1000000000 _sum 1000000000 for i in range(_min, _max+1):
    temp = 0
    for x in X:
        temp += (x - i) * (x - i)
    if temp < _sum:
        _sum = temp i range(_min, _max+1) range _min _max+1 _max 1 temp = 0 temp 0 for x in X:
        temp += (x - i) * (x - i)
     x X temp += (x - i) * (x - i) temp (x - i) * (x - i) x - i x i x - i x i if temp < _sum:
        _sum = temp temp < _sum temp _sum _sum = temp _sum temp print(_sum) print _sum temp = 0 0 temp N = int(input()) int(input()) N _max = max(X) max(X) _max _sum = temp temp _sum _min = min(X) min(X) _min X = list(map(int, input().split())) list(map(int, input().split())) X _sum = 1000000000 1000000000 _sum temp += (x - i) * (x - i) (x - i) * (x - i) temp
N = int(input())
X = list(map(int, input().split()))
_min = min(X)
_max = max(X)
_sum = 1000000000
for i in range(_min, _max+1):
    temp = 0
    for x in X:
        temp += (x - i) * (x - i)
    if temp < _sum:
        _sum = temp
print(_sum)
