A. Lucky Permutation
time limit per test
memory limit per test
input
output
p of size n is the sequence p1, p2, ..., pn, consisting of n distinct integers, each of them is from 1 to n (1 ≤ pi ≤ n).
p, that any integer i (1 ≤ i ≤ n) meets this condition ppi = n - i + 1.
n. Find some lucky permutation p of size n.
Input
n (1 ≤ n ≤ 105) — the required permutation size.
Output
p of size n
n distinct integers p1, p2, ..., pn (1 ≤ pi ≤ n)
If there are multiple answers, you can print any of them.
Sample test(s)
input
1
output
1
input
2
output
-1
input
4
output
2 4 1 3
input
5
output
2 5 3 1 4
找规律
如图所示