import Numeric

mink :: Int -> Int -> [Int] -> [Int] -> Double
mink p n xs ys = fromIntegral (foldr step 0 (zip xs ys)) ** (1 / fromIntegral p)
  where step (x, y) sum = sum + (abs (x - y)) ^ p

cheby n xs ys = maximum $ map (\t -> abs (fst t - snd t)) (zip xs ys)

main = do
  n <- readLn :: IO Int
  xs <- fmap (map read . words) getLine :: IO [Int]
  ys <- fmap (map read . words) getLine :: IO [Int]
  putStrLn $ show $ mink 1 n xs ys
  putStrLn $ show $ mink 2 n xs ys
  putStrLn $ show $ mink 3 n xs ys
  putStrLn $ show $ cheby n xs ys