module Main where
--import Debug.Trace
import Data.List
import Data.Char
import Data.Array
import Data.Maybe
import Data.Ord
import Control.Monad

solve :: [[Double]] -> [Double]
solve [x, y] = iter 0 0 0 0 x y where
    iter m1 m2 m3 mi [] [] = m1:m2**(1/2):m3**(1/3):mi:[]
    iter m1 m2 m3 mi (x:xs) (y:ys) = iter (m1+d) (m2+d^2) (m3+d^3) (if mi < d then d else mi) xs ys
        where d = abs (x-y)  
readLine:: IO [Double]
readLine = fmap (map read . words) getLine

readLines :: Int -> IO [[Double]]
readLines 0 = return []
readLines n = readLine >>= (\a -> fmap (a:) (readLines (pred n)))
            
main :: IO() 
main = do
    n <- readLn::IO Int
    l <- readLines 2
    print l
    mapM_ print (solve l)

