public static long binsearchN2 ( long left , long right , int N ) {
  if ( left >= right ) return ( long ) Math . pow ( right , 2 ) ;
  long mid = ( left + right ) / 2 ;
  if ( Math . pow ( mid , 2 ) > N ) return binsearchN2 ( left , mid - 1 , N ) ;
  else {
    if ( Math . pow ( mid + 1 , 2 ) > N ) return ( long ) Math . pow ( mid , 2 ) ;
    else return binsearchN2 ( mid + 1 , right , N ) ;
  }
}

public static long binsearchN2 ( long left , long right , int N ) { if ( left >= right ) return ( long ) Math . pow ( right , 2 ) ; long mid = ( left + right ) / 2 ; if ( Math . pow ( mid , 2 ) > N ) return binsearchN2 ( left , mid - 1 , N ) ; else { if ( Math . pow ( mid + 1 , 2 ) > N ) return ( long ) Math . pow ( mid , 2 ) ; else return binsearchN2 ( mid + 1 , right , N ) ; } }
(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))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (return_statement (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal)))))) (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal))) right: (identifier))) consequence: (return_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier)))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (decimal_integer_literal))) right: (identifier))) consequence: (return_statement (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal))))) alternative: (return_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier) (identifier)))))))))