static void printArray ( int [ ] A , int n , int K ) {
  int minEle = Integer . MAX_VALUE , maxEle = Integer . MAX_VALUE ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    minEle = Math . min ( minEle , A [ i ] ) ;
    maxEle = Math . max ( maxEle , A [ i ] ) ;
  }
  if ( K != 0 ) {
    if ( K % 2 == 1 ) {
      for ( int i = 0 ;
      i < n ;
      i ++ ) A [ i ] = maxEle - A [ i ] ;
    }
    else {
      for ( int i = 0 ;
      i < n ;
      i ++ ) A [ i ] = A [ i ] - minEle ;
    }
  }
  for ( int i = 0 ;
  i < n ;
  i ++ ) System . out . print ( A [ i ] + " " ) ;
}

static void printArray ( int [ ] A , int n , int K ) { int minEle = Integer . MAX_VALUE , maxEle = Integer . MAX_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { minEle = Math . min ( minEle , A [ i ] ) ; maxEle = Math . max ( maxEle , A [ i ] ) ; } if ( K != 0 ) { if ( K % 2 == 1 ) { for ( int i = 0 ; i < n ; i ++ ) A [ i ] = maxEle - A [ i ] ; } else { for ( int i = 0 ; i < n ; i ++ ) A [ i ] = A [ i ] - minEle ; } } for ( int i = 0 ; i < n ; i ++ ) System . out . print ( A [ i ] + " ▁ " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) 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: (field_access object: (identifier) field: (identifier))) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (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: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (array_access array: (identifier) index: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (array_access array: (identifier) index: (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (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: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))))) alternative: (block (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: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (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: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (string_literal))))))))