Perfect Permutation
题意翻译
## 题目描述
现有一个$1$~$n$的排列$p_1,p_2,...,p_n$。
$Nickolas$喜欢排列,他认为有一种排列是完美的。用$p_i$表示排列中的第$i$个元素,则完美的排列符合如下性质:
1. $p_{p_i}=i$
2. $p_i≠i$
现在给出$n$的值,请求出这个完美的排列。
## 输入输出格式
### 输入格式:
仅一行,一个整数$n(1≤n≤ 100)$
### 输出格式:
如果排列不存在,输出$-1$,否则输出完美排列,数字之间用空格隔开。
```
## 题目描述
现有一个$1$~$n$的排列$p_1,p_2,...,p_n$。
$Nickolas$喜欢排列,他认为有一种排列是完美的。用$p_i$表示排列中的第$i$个元素,则完美的排列符合如下性质:
1. $p_{p_i}=i$
2. $p_i≠i$
现在给出$n$的值,请求出这个完美的排列。
## 输入输出格式
### 输入格式:
仅一行,一个整数$n(1≤n≤ 100)$
### 输出格式:
如果排列不存在,输出$-1$,否则输出完美排列,数字之间用空格隔开。
```
题目描述
A permutation is a sequence of integers $ p_{1},p_{2},...,p_{n} $ , consisting of $ n $ distinct positive integers, each of them doesn't exceed $ n $ . Let's denote the $ i $ -th element of permutation $ p $ as $ p_{i} $ . We'll call number $ n $ the size of permutation $ p_{1},p_{2},...,p_{n} $ .
Nickolas adores permutations. He likes some permutations more than the others. He calls such permutations perfect. A perfect permutation is such permutation $ p $ that for any $ i $ $ (1<=i<=n) $ ( $ n $ is the permutation size) the following equations hold $ p_{pi}=i $ and $ p_{i}≠i $ . Nickolas asks you to print any perfect permutation of size $ n $ for the given $ n $ .
输入输出格式
输入格式
A single line contains a single integer $ n $ ( $ 1<=n<=100 $ ) — the permutation size.
输出格式
If a perfect permutation of size $ n $ doesn't exist, print a single integer -1. Otherwise print $ n $ distinct integers from 1 to $ n $ , $ p_{1},p_{2},...,p_{n} $ — permutation $ p $ , that is perfect. Separate printed numbers by whitespaces.
输入输出样例
输入样例 #1
1
输出样例 #1
-1
输入样例 #2
2
输出样例 #2
2 1
输入样例 #3
4
输出样例 #3
2 1 4 3