import Data.Ratio import Text.Printf apply n f x = foldr ($) x (replicate n f) lmin = 0 lmax = 10e9 nbs = 50 main = do getLine ls <- map (fromIntegral . read) . words <$> getLine k <- readLn printf "%.12f" (yokuaru k ls) yokuaru :: Integer -> [Ratio Integer] -> Double yokuaru k ls = fromRational (fst (apply nbs (bsearch k ls) (1,(lmin,lmax)))) bsearch k ls (x,(xn,xx)) | cuts x ls < k = (x - (x-xn) / 2, (xn,x)) | otherwise = (x + (xx-x) / 2, (x,xx)) cuts x = sum . map (floor . (/x))