n = STDIN.gets.chomp.to_i
x = STDIN.gets.chomp.split(" ")
y = STDIN.gets.chomp.split(" ")

0.upto(n - 1) { |i|
	x[i] = x[i].to_f
	y[i] = y[i].to_f
}

p1_d = 0
p2_d = 0
p3_d = 0
pi_d = 0

0.upto(n - 1) { |i|
	diff = (x[i] - y[i]).abs	
	p1_d += diff
	p2_d += diff ** 2
	p3_d += diff ** 3
	pi_d = diff if pi_d < diff
}

p2_d = p2_d ** (1 / 2.0)
p3_d = p3_d ** (1 / 3.0)
	
p p1_d
p p2_d
p p3_d
p pi_d

