n=gets.to_i
x=gets.split.map(&:to_f)
y=gets.split.map(&:to_f)
dis=(1..n-1).map{|i| (x[i]-y[i]).abs}
puts dis.reduce(:+)
puts (dis.map{|i|i**2}.reduce(:+))*(1/2.0)
puts (dis.map{|i|i**3}.reduce(:+))*(1/3.0)
puts (dis.map{|i|i**Float::INFINITY}.reduce(:+))*(1/Float::INFINITY)