def calMinkowski(n,x,y,p)
    d = 0
    max = 0
    n.times do |i|
        abs = (x[i]-y[i]).abs.to_f
        max = abs if max < abs
        d += abs**p
    end
    if p == -1 then
        max
    else
        d = d**(1/p.to_f)
    end
end
n = gets.to_i
x = gets.split.map(&:to_i)
y = gets.split.map(&:to_i)

puts calMinkowski(n,x,y,1)
puts calMinkowski(n,x,y,2)
puts calMinkowski(n,x,y,3)
puts calMinkowski(n,x,y,-1)
