import Data.Functor( (<$>))
import Text.Printf( printf)

main = do
    n <- read <$> getLine   ::IO Int
    xs <- (read <$>) . words <$> getLine
    ys <- (read <$>) . words <$> getLine
    let
	manhattan_base::[Double]
	manhattan_base = abs <$> zipWith (-) xs ys
	euclidean = sqrt . sum $ (^2) <$> manhattan_base
	l3 =  cubicrtMacro 1 0 . sum $ (^3) <$> manhattan_base
	chebyshev = maximum manhattan_base

	cubicrtMacro try last target
	  = let
		v = try^3
		diff = abs $ v - target
		macro = 2 * (try - last)
		micro = (try - last) / 2
	    in
		if diff < 0.000000000000001
		then try
		else if v < target
		    then cubicrtMacro (try + macro) try target
		    else cubicrtMicro (try - micro) try target

	cubicrtMicro try last target
	  = let
		v = try^3
		diff = abs $ v - target
		micro =  abs $ (try - last) / 2
	    in
		if micro < 0.000000000000001
		then try
		else if v < target
		    then cubicrtMicro (try + micro) try target
		    else cubicrtMicro (try - micro) try target

    printf "%.5f\n" $ sum manhattan_base
    printf "%.5f\n" euclidean
    printf "%.5f\n" l3
    printf "%.5f\n" chebyshev

