import Control.Applicative import qualified Data.Vector as V import qualified Data.ByteString.Char8 as B import Data.Maybe (mapMaybe) import Text.Printf data Heap a = Empty | Heap {value :: a, left :: Heap a, right :: Heap a} singleton :: a -> Heap a singleton x = Heap x Empty Empty meld :: (Ord a) => Heap a -> Heap a -> Heap a meld Empty h2 = h2 meld h1 Empty = h1 meld h1 h2 | value h1 >= value h2 = h1 {left = meld (right h1) h2, right = left h1} | otherwise = h2 {left = meld (right h2) h1, right = left h2} removeMin :: (Ord a) => Heap a -> (a, Heap a) removeMin h = (value h, meld (left h) (right h)) readNum :: (Num a) => IO [a] readNum = map (fromIntegral . fst) . mapMaybe B.readInt . B.words <$> B.getLine main = do n <- readLn ls <- readNum :: IO [Double] _ <- getLine ks <- readNum let ls' = V.fromList ls heap = foldr (\i h -> meld (singleton (ls' V.! i, i, 1)) h) Empty $ [0..n-1] f t h | t > 500000 = [] | otherwise = let ((x, y, z), h') = removeMin h in x : f (t+1) (meld (singleton (ls' V.! y / (z+1), y, z+1)) h') xs = V.fromList $ f 1 heap in mapM (printf "%.30f\n" . (xs V.!) . (subtract 1)) ks