let m, c, (n, h) = ref 0, ref 0, Scanf.scanf " %d %d" @@ fun a b -> a, ref b
let bs = Array.init n @@ fun _ -> Scanf.scanf " %d %d" @@ fun a b -> m := max !m a; b
let _ = Array.(sort (fun x y -> y - x) bs; iter (fun b -> if b > !m then (if !h > 0 then (incr c; h := !h - b))) bs); Printf.printf "%d\n" @@ !c + (max 0 !h + !m - 1) / !m