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

res = [0.0]*4
a.zip(b).each do |x,y|
  3.times do |i|
    res[i] += (x-y).abs**(i+1)
  end
  res[3] = [res[3], (x-y).abs].max
end

puts res