public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int N = sc . nextInt ( ) ;
  long H = sc . nextInt ( ) ;
  PriorityQueue < Entry > sords = new PriorityQueue < Entry > ( new EntryComparator ( ) ) ;
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    sords . add ( new Entry ( sc . nextLong ( ) , false ) ) ;
    sords . add ( new Entry ( sc . nextLong ( ) , true ) ) ;
  }
  int cnt = 0 ;
  long aAttach = - 1l ;
  while ( H > 0 ) {
    Entry entry = sords . poll ( ) ;
    if ( ! entry . isB ) {
      aAttach = entry . attack ;
      break ;
    }
    H -= entry . attack ;
    cnt ++ ;
  }
  if ( aAttach != - 1 ) {
    cnt += ( long ) Math . ceil ( ( double ) H / aAttach ) ;
  }
  out . println ( cnt ) ;
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long H = sc . nextInt ( ) ; PriorityQueue < Entry > sords = new PriorityQueue < Entry > ( new EntryComparator ( ) ) ; for ( int i = 0 ; i < N ; i ++ ) { sords . add ( new Entry ( sc . nextLong ( ) , false ) ) ; sords . add ( new Entry ( sc . nextLong ( ) , true ) ) ; } int cnt = 0 ; long aAttach = - 1l ; while ( H > 0 ) { Entry entry = sords . poll ( ) ; if ( ! entry . isB ) { aAttach = entry . attack ; break ; } H -= entry . attack ; cnt ++ ; } if ( aAttach != - 1 ) { cnt += ( long ) Math . ceil ( ( double ) H / aAttach ) ; } out . println ( cnt ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier))) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) (false)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) (true)))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (unary_expression operand: (field_access object: (identifier) field: (identifier)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) (break_statement))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) (expression_statement (update_expression (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (cast_expression type: (floating_point_type) value: (identifier)) right: (identifier))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))