public static int lowerBound ( long [ ] a , int l , int r , long val ) {
  if ( r - l == 1 ) {
    if ( a [ l ] < val ) return r ;
    return l ;
  }
  int mid = ( l + r ) / 2 ;
  if ( a [ mid ] < val ) {
    return lowerBound ( a , mid , r , val ) ;
  }
  else {
    return lowerBound ( a , l , mid , val ) ;
  }
}

public static int lowerBound ( long [ ] a , int l , int r , long val ) { if ( r - l == 1 ) { if ( a [ l ] < val ) return r ; return l ; } int mid = ( l + r ) / 2 ; if ( a [ mid ] < val ) { return lowerBound ( a , mid , r , val ) ; } else { return lowerBound ( a , l , mid , val ) ; } }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) consequence: (return_statement (identifier))) (return_statement (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) consequence: (block (return_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier))))) alternative: (block (return_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier))))))))