n = input()
x = list(map(int,input().split()))
print(min(sum((i-j)**2 for j in x) for i in range(min(x),max(x)+1))) n = input() n 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 print(min(sum((i-j)**2 for j in x) for i in range(min(x),max(x)+1))) print min(sum((i-j)**2 for j in x) for i in range(min(x),max(x)+1)) min sum((i-j)**2 for j in x) sum (i-j)**2 i-j i j 2 n = input() input() n x = list(map(int,input().split())) list(map(int,input().split())) x
n = input()
x = list(map(int,input().split()))
print(min(sum((i-j)**2 for j in x) for i in range(min(x),max(x)+1)))