7480: [CSES Problem Set] Permutations
[Creator : ]
Description
A permutation of integers $1,2,…,n$ is called beautiful if there are no adjacent elements whose difference is $1$.
Given $n$, construct a beautiful permutation if such a permutation exists.
Given $n$, construct a beautiful permutation if such a permutation exists.
Input
The only input line contains an integer $n$.
Output
Print a beautiful permutation of integers $1,2,…,n$. If there are several solutions, you may print any of them. If there are no solutions, print "NO SOLUTION".
Constraints
$1 \leq n \leq 10^6$
Sample 1 Input
5
Sample 1 Output
4 2 5 3 1
Sample 2 Input
3
Sample 2 Output
NO SOLUTION