{-# LANGUAGE BangPatterns #-}
import Control.Arrow
import Control.Monad.Fix
import Data.Foldable
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import qualified Data.ByteString.Char8 as B
import Data.ByteString.Internal (accursedUnutterablePerformIO)
import Debug.Trace

solve :: Int -> Int -> Int -> VU.Vector Int -> Int
solve n a b hs = if check 1
  then 1
  else let s = findInternal 1 in binsearch (s `div` 2) s
 where
  check n = calc n <= n

  findInternal k = head $ dropWhile (not . check) $ map (2 ^) [0 ..]

  calc k = VU.sum $ VU.map
    (\h -> ceiling (fromIntegral (h - k * b) / fromIntegral (a - b)) `max` 0)
    hs

  -- search in (x,y]
  binsearch x y
    | y - x == 1
    = y
    | otherwise
    = let z = (x + y) `div` 2
      in  if calc z <= z then binsearch x z else binsearch z y

main = do
  let readInt = fmap (second B.tail) . B.readInt

  (n, a, b) <-
    (\vec -> (vec VU.! 0, vec VU.! 1, vec VU.! 2))
    .   VU.unfoldrN 3 readInt
    <$> B.getLine
  hs <-
    VU.replicateM n
    $   (\vec -> (vec VU.! 0))
    .   VU.unfoldrN 1 readInt
    <$> B.getLine
  print $ solve n a b hs
