$stdin = DATA if $stdin.eof?

gets
xn = gets.split.map(&:to_i)
yn = gets.split.map(&:to_i)

[1,2,3].each do |p|
  sum = [xn, yn].transpose.map do |x,y|
    (x - y).abs ** p
  end.inject(0.0, &:+)

  puts sum ** (1.0/p)
end

pi = [xn, yn].transpose.map do |x,y|
  (x - y).abs
end

puts pi.max
__END__
3
1 2 3
2 0 4