n = gets.chomp.to_i
x = gets.chomp.split.map(&:to_i)
y = gets.chomp.split.map(&:to_i)

manhattan = 0
n.times do |i|
  manhattan += (x[i] - y[i]).abs
end

puts format("%.6f", manhattan)

euclid = 0
n.times do |i|
  euclid +=  ((x[i] - y[i]).abs ** 2)
end
puts format("%.6f", Math.sqrt(euclid))

value = 0
n.times do |i|
  value +=  ((x[i] - y[i]).abs ** 3)
end
puts format("%.6f", Math.cbrt(value))

chebyshev = 0

n.times do |i|
  chebyshev =  [chebyshev, (x[i] - y[i]).abs].max
end
puts format("%.6f", chebyshev)

