static void merge ( long a [ ] , int left , int right , int mid ) {
  int n1 = mid - left + 1 , n2 = right - mid ;
  long L [ ] = new long [ n1 ] ;
  long R [ ] = new long [ n2 ] ;
  for ( int i = 0 ;
  i < n1 ;
  i ++ ) {
    L [ i ] = a [ left + i ] ;
  }
  for ( int i = 0 ;
  i < n2 ;
  i ++ ) {
    R [ i ] = a [ mid + 1 + i ] ;
  }
  int i = 0 , j = 0 , k = left ;
  while ( i < n1 && j < n2 ) {
    if ( L [ i ] <= R [ j ] ) {
      a [ k ] = L [ i ] ;
      i ++ ;
    }
    else {
      a [ k ] = R [ j ] ;
      j ++ ;
    }
    k ++ ;
  }
  while ( i < n1 ) {
    a [ k ] = L [ i ] ;
    k ++ ;
    i ++ ;
  }
  while ( j < n2 ) {
    a [ k ] = R [ j ] ;
    j ++ ;
    k ++ ;
  }
}

static void merge ( long a [ ] , int left , int right , int mid ) { int n1 = mid - left + 1 , n2 = right - mid ; long L [ ] = new long [ n1 ] ; long R [ ] = new long [ n2 ] ; for ( int i = 0 ; i < n1 ; i ++ ) { L [ i ] = a [ left + i ] ; } for ( int i = 0 ; i < n2 ; i ++ ) { R [ i ] = a [ mid + 1 + i ] ; } int i = 0 , j = 0 , k = left ; while ( i < n1 && j < n2 ) { if ( L [ i ] <= R [ j ] ) { a [ k ] = L [ i ] ; i ++ ; } else { a [ k ] = R [ j ] ; j ++ ; } k ++ ; } while ( i < n1 ) { a [ k ] = L [ i ] ; k ++ ; i ++ ; } while ( j < n2 ) { a [ k ] = R [ j ] ; j ++ ; k ++ ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier)) (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: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (identifier))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier)))) body: (block (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: (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (identifier)))) alternative: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (identifier))))) (expression_statement (update_expression (identifier))))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier))))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier)))))))