import Text.Printf

main = interact $ show' . solve . read'
  where
    show' = unlines . map (printf "%.9f")
    solve xs = [minkovsky 1 xs, minkovsky 2 xs, minkovsky 3 xs, minkovsky (-1) xs]
    minkovsky p [a, b] = (g $ zipWith f a b) ** (1 / p')
      where
        f x y = (abs (x - y)) ** p'
        g | p == -1 = foldr1 max
          | otherwise = sum
        p' | p == -1 = 1
           | otherwise = p
    read' = map (map read . words) . tail . lines :: String -> [[Double]]

