num = STDIN.gets.to_i
line0 = STDIN.gets.split(" ")
vec0 = Array.new(num) { |i|  i = line0[i].to_i}
line1 = STDIN.gets.split(" ")
vec1 = Array.new(num) { |i|  i = line1[i].to_i}

max = 0.0
for i in 1..num do
  output = 0.0
  for j in 1..num do
    output += (vec0[j - 1] - vec1[j - 1]).abs ** i
    if i == 1 then
      if j == 1 then
        max = (vec0[j - 1] - vec1[j - 1]).abs
      else
        d = (vec0[j - 1] - vec1[j - 1]).abs
        if d > max then
          max = d
        end
      end
    end
  end
  puts sprintf("%.6f", output ** (1.0 / i))
end

puts sprintf("%.6f", max)