import           Control.Monad
import           Data.List
import           Debug.Trace

main :: IO ()
main = do
    [n, h] <- getInts
    ab <- replicateM n $ do
        [a, b] <- getInts
        return (a, b)
    print $ solve ab h

getInts :: IO [Int]
getInts = map read . words <$> getLine

solve xs h = -- trace (show bs') $
    if head bs' > h
    then length bs' - 1
    else f
    where
      a = maximum $ map fst xs
      bs =  scanl' (+) 0
          $ takeWhile (> a)
          $ sortBy (flip compare)
          $ map snd xs
      bs' = go bs
          where
            go [] = []
            go (x:xs)
                | x >= h = [x]
                | otherwise =  go xs ++ [x]
      f = let b' = length bs' - 1 in
          b' + (h - (head bs') + (a - 1)) `div` a
