object Main {
  def main(args: Array[String]): Unit = {
    val _ = io.StdIn.readLine()
    val d = io.StdIn.readLine() zip io.StdIn.readLine() map { case (x, y) => Math.abs(x - y) }

    println(f"${d.sum.toDouble}%.8f")
    println(f"${Math.sqrt(d.map(v => v * v).sum)}%.8f")
    println(f"${Math.cbrt(d.map(v => v * v * v).sum)}%.8f")
    println(f"${d.max.toDouble}%.8f")
  }
}