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

sum = Array.new(3,0)
d = Array.new(3,0)
values = Array.new(3,0)
(1..3).each do |a|
    (0..(x.size-1)).each do |i|
        val = (x[i] - y[i]).abs
        values[a-1] = val if values[a-1] < val
        sum[a-1] += val**a
    end
    puts d[a-1] = sum[a-1]**(1.0/a)
end

p values.max
