main :: IO()
main = getContents >>= putOut.formatOut.solve.formatIn
  where putOut s | null s || last s == '\n' = putStr s
                 | otherwise                = putStrLn s
   
formatIn :: String -> [[Double]]
formatIn = map (map read.words).tail.lines

formatOut :: [Double] -> String
formatOut = unlines.map (show.(/1000000).realToFrac.floor.(*1000000))
 
solve :: [[Double]] -> [Double]
solve (xs:ys:_) = map (minkowski xs ys) [1,2,3,(1/0)]

minkowski :: [Double] -> [Double] -> Double -> Double
minkowski x y p | isInfinite p = maximum $zipWith ((abs.).(-)) x y 
                | otherwise    = (**(1/p)).sum $zipWith ((((**p).abs).).(-)) x y 