let n, h = Scanf.scanf " %d %d" @@ fun a b -> a, ref b
let ab_s, ans = Array.make (n + n) (0, false), ref 0
let f _ = Printf.printf "%d\n" !ans; exit 0
let _ = for i = 0 to n - 1 do Scanf.scanf " %d %d" @@ fun a b -> ab_s.(2 * i) <- a, false; ab_s.(2 * i + 1) <- b, true done;
  Array.(sort (fun x y -> compare y x) ab_s; iter (fun (x, b) -> if b then (h := !h - x; incr ans; if !h <= 0 then f ()) else (ans := !ans + (!h + x - 1) / x; f ()))) ab_s