static int solve ( int n , int m , int obstacles , double range [ ] ) {
  double val = Math . min ( n , m ) ;
  Arrays . sort ( range ) ;
  int c = 1 ;
  for ( int i = obstacles - 1 ;
  i >= 0 ;
  i -- ) {
    range [ i ] = 2 * range [ i ] ;
    val -= range [ i ] ;
    if ( val <= 0 ) {
      return c ;
    }
    else {
      c ++ ;
    }
  }
  if ( val > 0 ) {
    return - 1 ;
  }
  return 0 ;
}

static int solve ( int n , int m , int obstacles , double range [ ] ) { double val = Math . min ( n , m ) ; Arrays . sort ( range ) ; int c = 1 ; for ( int i = obstacles - 1 ; i >= 0 ; i -- ) { range [ i ] = 2 * range [ i ] ; val -= range [ i ] ; if ( val <= 0 ) { return c ; } else { c ++ ; } } if ( val > 0 ) { return - 1 ; } return 0 ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (floating_point_type) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (decimal_integer_literal) right: (array_access array: (identifier) index: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (return_statement (identifier))) alternative: (block (expression_statement (update_expression (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (return_statement (unary_expression operand: (decimal_integer_literal))))) (return_statement (decimal_integer_literal))))