import Control.Applicative
import Control.Monad
import Text.Printf

main :: IO ()
main = do
  n <- readLn :: IO Int
  xs <- map read . words <$> getLine :: IO [Double]
  ys <- map read . words <$> getLine :: IO [Double]
  mapM_ (printf "%.6f\n" . minkowski xs ys) [Just 1, Just 2, Just 3, Nothing]

minkowski :: [Double] -> [Double] -> Maybe Double -> Double
minkowski xs ys Nothing = maximum $ zipWith (\x y -> abs (x-y)) xs ys
minkowski xs ys (Just p) = sum (zipWith (\x y -> abs (x-y)**p) xs ys)**(1/p)