n = int(input())
x = list(map(int,input().split()))
answer = 0

for i in range(min(x),max(x)+1):
	result = 0
	for j in range(n):
		result += (x[j] - i) ** 2
	if answer == 0 or answer > result:
		answer = result
		number = i

print(answer) 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 answer = 0 answer 0 for i in range(min(x),max(x)+1):
	result = 0
	for j in range(n):
		result += (x[j] - i) ** 2
	if answer == 0 or answer > result:
		answer = result
		number = i i range(min(x),max(x)+1) range min(x) min x max(x)+1 max(x) max x 1 result = 0 result 0 for j in range(n):
		result += (x[j] - i) ** 2
	 j range(n) range n result += (x[j] - i) ** 2 result (x[j] - i) ** 2 x[j] - i x[j] x j i 2 if answer == 0 or answer > result:
		answer = result
		number = i answer == 0 or answer > result answer == 0 answer 0 answer > result answer result answer = result answer result number = i number i print(answer) print answer answer = 0 0 answer number = i i number result += (x[j] - i) ** 2 (x[j] - i) ** 2 result result = 0 0 result n = int(input()) int(input()) n x = list(map(int,input().split())) list(map(int,input().split())) x answer = result result answer
n = int(input())
x = list(map(int,input().split()))
answer = 0

for i in range(min(x),max(x)+1):
	result = 0
	for j in range(n):
		result += (x[j] - i) ** 2
	if answer == 0 or answer > result:
		answer = result
		number = i

print(answer)