static int maxTeams ( int N1 , int N2 ) {
  int count = 0 ;
  while ( N1 > 0 && N2 > 0 && N1 + N2 >= 3 ) {
    if ( N1 > N2 ) {
      N1 -= 2 ;
      N2 -= 1 ;
    }
    else {
      N1 -= 1 ;
      N2 -= 2 ;
    }
    count ++ ;
  }
  return count ;
}

static int maxTeams ( int N1 , int N2 ) { int count = 0 ; while ( N1 > 0 && N2 > 0 && N1 + N2 >= 3 ) { if ( N1 > N2 ) { N1 -= 2 ; N2 -= 1 ; } else { N1 -= 1 ; N2 -= 2 ; } count ++ ; } return count ; }
(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))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (expression_statement (update_expression (identifier))))) (return_statement (identifier))))