let split = Str.split (Str.regexp_string " ");;

let (d1,d2,d3,d4) =
  let n = read_int () in
  let list1 = read_line () |> split |> List.map float_of_string and
      list2 = read_line () |> split |> List.map float_of_string in
  let rec loop (w,x,y,z) = function
      i when i = n -> (w,x,y,z)
    | i -> let t = abs_float ((List.nth list1 i)-.(List.nth list2 i)) in
           loop (w +. t, x +. t**2., y +. t**3., if t> z then t else z) (i+1)in
  loop (0.,0.,0.,0.) 0;;

let () = Printf.printf "%f\n%f\n%f\n%f\n" d1 (d2**0.5) (d3**(1./.3.)) d4;;