
n = gets.to_i
a = gets.split.map(&:to_f)
b = gets.split.map(&:to_f)
c = Array.new(n)

for j in 0..(n-1)
c[j] = (a[j]-b[j]).abs
end

d = c.max

for e in 1..3

sum = 0
for j in 0..(n-1)
sum += c[j]**e
end

puts sum**(1.0/(e.to_f))

end

puts d

