import Control.Applicative
import Data.List

main = do
    _ <- getLine
    (a:b:_) <- map read . words <$> getLine
    c <- readLn
    toppings <- map read . lines <$> getContents
    print $ solve a b c toppings

solve :: Int -> Int -> Int -> [Int] -> Int
solve basePrice toppingPrice baseCalories =
    maximum . map (uncurry div)
        . scanl (\(cp,cc) t -> (cp+toppingPrice,t)) (basePrice,baseCalories)
        . sortBy (flip compare)