{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import           Control.Monad         (replicateM)
import qualified Data.ByteString.Char8 as BC
import           Data.List             (sort)
import           Data.Maybe            (fromJust)

main :: IO ()
main = print =<< solve <$> getInput

getInput :: IO (Int, Int, [(Int, Int)])
getInput = do
  [n, h] <- readInts
  abs <- replicateM n readInt2
  return (n, h, abs)

readInts = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

readInt2 = do
  [a, b] <- readInts
  return (a, b)

solve (n, h, abs) = nAttack + mAttack
  where maxA = maximum $ map fst abs
        (nAttack, restHP) = throwAttack maxA (map snd abs) h
        mAttack = swingAttack maxA restHP

throwAttack :: Int -> [Int] -> Int -> (Int, Int)
throwAttack a bs h = if null powerfulBs
  then (0, h)
  else if null rest
       then (length throwns, h - last throwns)
       else (length throwns + 1, h - head rest)
  where powerfulBs = filter (> a) bs
        (throwns, rest) = span (<= h) . scanl1 (+) . reverse $ sort powerfulBs

swingAttack a h
  | h <= 0   = 0
  | otherwise = h `div` a + if h `mod` a == 0 then 0 else 1
      --ceiling $ fromIntegral h / fromIntegral a
