static void printPermutation ( int n , int k ) {
  if ( k >= n || ( n % 2 == 0 && k == 0 ) ) {
    System . out . print ( - 1 ) ;
    return ;
  }
  int per [ ] = new int [ n + 1 ] , i ;
  for ( i = 1 ;
  i <= n ;
  i ++ ) {
    per [ i ] = i ;
  }
  int cnt = n - 1 ;
  i = 2 ;
  while ( i < n ) {
    if ( cnt - 1 > k ) {
      swap ( per , i , i + 1 ) ;
      cnt -= 2 ;
    }
    else if ( cnt - 1 == k ) {
      swap ( per , 1 , i ) ;
      cnt -- ;
    }
    else {
      break ;
    }
    i += 2 ;
  }
  for ( i = 1 ;
  i <= n ;
  i ++ ) {
    System . out . print ( per [ i ] + " " ) ;
  }
}

static void printPermutation ( int n , int k ) { if ( k >= n || ( n % 2 == 0 && k == 0 ) ) { System . out . print ( - 1 ) ; return ; } int per [ ] = new int [ n + 1 ] , i ; for ( i = 1 ; i <= n ; i ++ ) { per [ i ] = i ; } int cnt = n - 1 ; i = 2 ; while ( i < n ) { if ( cnt - 1 > k ) { swap ( per , i , i + 1 ) ; cnt -= 2 ; } else if ( cnt - 1 == k ) { swap ( per , 1 , i ) ; cnt -- ; } else { break ; } i += 2 ; } for ( i = 1 ; i <= n ; i ++ ) { System . out . print ( per [ i ] + " ▁ " ) ; } }
(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: (binary_expression left: (identifier) right: (identifier)) right: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (unary_expression operand: (decimal_integer_literal))))) (return_statement))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal))))) declarator: (variable_declarator name: (identifier))) (for_statement init: (assignment_expression left: (identifier) right: (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: (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))) consequence: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))) consequence: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal) (identifier)))) (expression_statement (update_expression (identifier)))) alternative: (block (break_statement)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (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)))))))))