static void merge ( int left , int right ) {
  if ( left >= right ) return ;
  int mid = ( left + right ) / 2 ;
  merge ( left , mid ) ;
  merge ( mid + 1 , right ) ;
  int i = left , j = mid + 1 , k = 0 ;
  long [ ] temp = new long [ right - left + 1 ] ;
  while ( i <= mid && j <= right ) {
    if ( sum [ i ] <= sum [ j ] ) {
      tot += mid - i + 1 ;
      temp [ k ++ ] = sum [ j ++ ] ;
    }
    else temp [ k ++ ] = sum [ i ++ ] ;
  }
  while ( i <= mid ) temp [ k ++ ] = sum [ i ++ ] ;
  while ( j <= right ) temp [ k ++ ] = sum [ j ++ ] ;
  for ( int m = 0 ;
  m < temp . length ;
  m ++ ) sum [ left + m ] = temp [ m ] ;
}

static void merge ( int left , int right ) { if ( left >= right ) return ; int mid = ( left + right ) / 2 ; merge ( left , mid ) ; merge ( mid + 1 , right ) ; int i = left , j = mid + 1 , k = 0 ; long [ ] temp = new long [ right - left + 1 ] ; while ( i <= mid && j <= right ) { if ( sum [ i ] <= sum [ j ] ) { tot += mid - i + 1 ; temp [ k ++ ] = sum [ j ++ ] ; } else temp [ k ++ ] = sum [ i ++ ] ; } while ( i <= mid ) temp [ k ++ ] = sum [ i ++ ] ; while ( j <= right ) temp [ k ++ ] = sum [ j ++ ] ; for ( int m = 0 ; m < temp . length ; m ++ ) sum [ left + m ] = temp [ m ] ; }
(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 (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (return_statement)) (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)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier)) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal))) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))) (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: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (update_expression (identifier))) right: (array_access array: (identifier) index: (update_expression (identifier)))))) alternative: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (update_expression (identifier))) right: (array_access array: (identifier) index: (update_expression (identifier)))))))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (update_expression (identifier))) right: (array_access array: (identifier) index: (update_expression (identifier)))))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (update_expression (identifier))) right: (array_access array: (identifier) index: (update_expression (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: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) right: (array_access array: (identifier) index: (identifier)))))))