n = int(input())
x = [int(s) for s in input().split()]
hp = []
for i in range(min(x),max(x) + 1):
    sum_ = 0
    for j in x:
        sum_ = sum_ + (j - i)**2
    hp.append(sum_)
print(min(hp)) n = int(input()) n int(input()) int input() input int(s) for s in input().split() for s in input().split() s input().split() ().split () input split for s in input().split() int(s) int s x = [int(s) for s in input().split()] x [int(s) for s in input().split()] hp = [] hp [] for i in range(min(x),max(x) + 1):
    sum_ = 0
    for j in x:
        sum_ = sum_ + (j - i)**2
    hp.append(sum_) i range(min(x),max(x) + 1) range min(x) min x max(x) + 1 max(x) max x 1 sum_ = 0 sum_ 0 for j in x:
        sum_ = sum_ + (j - i)**2
     j x sum_ = sum_ + (j - i)**2 sum_ sum_ + (j - i)**2 sum_ (j - i)**2 j - i j i 2 hp.append(sum_) hp.append hp append sum_ print(min(hp)) print min(hp) min hp x = [int(s) for s in input().split()] [int(s) for s in input().split()] x hp = [] [] hp n = int(input()) int(input()) n sum_ = sum_ + (j - i)**2 sum_ + (j - i)**2 sum_ sum_ = 0 0 sum_
n = int(input())
x = [int(s) for s in input().split()]
hp = []
for i in range(min(x),max(x) + 1):
    sum_ = 0
    for j in x:
        sum_ = sum_ + (j - i)**2
    hp.append(sum_)
print(min(hp))