import           Control.Applicative

minkowski :: Double -> [Double] -> [Double] -> Double
minkowski p xs ys = (** (1/p)) . sum $ zipWith f xs ys
  where
    f x y = abs (x - y) ** p

chebyshev :: [Double] -> [Double] -> Double
chebyshev xs ys = maximum $ zipWith f xs ys
  where
    f x y = abs (x - y)

main :: IO ()
main = do
    getLine
    xs <- fmap read . words <$> getLine :: IO [Double]
    ys <- fmap read . words <$> getLine :: IO [Double]
    print $ minkowski 1 xs ys
    print $ minkowski 2 xs ys
    print $ minkowski 3 xs ys
    print $ chebyshev xs ys

