static void merge ( int a , int b ) {
  int u = find ( a ) ;
  int v = find ( b ) ;
  if ( u == v ) return ;
  if ( rank [ u ] >= rank [ v ] ) {
    parent [ v ] = u ;
    beauty [ u ] += beauty [ v ] ;
    weight [ u ] += weight [ v ] ;
  }
  else {
    parent [ u ] = v ;
    beauty [ v ] += beauty [ u ] ;
    weight [ v ] += weight [ u ] ;
  }
}

static void merge ( int a , int b ) { int u = find ( a ) ; int v = find ( b ) ; if ( u == v ) return ; if ( rank [ u ] >= rank [ v ] ) { parent [ v ] = u ; beauty [ u ] += beauty [ v ] ; weight [ u ] += weight [ v ] ; } else { parent [ u ] = v ; beauty [ v ] += beauty [ u ] ; weight [ v ] += weight [ u ] ; } }
(method_declaration (modifiers) type: (void_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: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (return_statement)) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier))))) alternative: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier))))))))