let () =
  let n, h = Scanf.scanf "%d %d " (fun a b -> a, b) in
  let l =  Array.to_list @@ Array.init n (fun _ -> Scanf.scanf "%d %d " (fun a b -> (a, b))) in

  let a = List.map (fun (a,b) -> a) l in
  let b = List.map (fun (a,b) -> b) l in

  let a =  List.sort (fun x y -> if x > y then -1 else if x = y then 0 else 1) a in
  let b =  List.sort (fun x y -> if x > y then -1 else if x = y then 0 else 1) b in

  let max_a = List.hd a in

  let bs = List.filter (fun x -> x > max_a) b in

  let rec f last res = function
    | [] -> res
    | hd :: tl -> 
      let last = last - hd in f last (last :: res) tl
  in
  let bd1 = f h [] bs in
  let bd2 = List.filter (fun x -> x > 0) bd1 in
  let bd1_len = List.length bd1 in
  let bd2_len = List.length bd2 in

  if bd1_len <> bd2_len then Printf.printf "%d\n" @@ bd2_len + 1
  else
    let b_sum = List.fold_left (+) 0 bs in

    Printf.printf "%d\n" @@ bd1_len +
                            (
                              if (h - b_sum) mod max_a = 0 then
                                (h - b_sum) / max_a
                              else 
                                (h - b_sum) / max_a + 1
                            )

