Beautiful Permutation
시간 제한1초메모리 제한512 MB
순열 a가 0부터 n-1까지의 값을 가지면서 |a_i - i|도 0부터 n-1까지의 순열이 되는 a를 구성하거나, 존재하지 않으면 NO를 출력한다.
문제
A permutation of is said to be beautiful if the sequence defined as is also a permutation of .
Given , construct a beautiful permutation of elements or determine that it does not exist.
입력
The first line contains a single integer (): the size of the permutation.
출력
If there is no beautiful permutation of elements, output a single line with the word "NO".
Otherwise, on the first line, print "YES", and on the second line, print space-separated integers : the beautiful permutation. If there are multiple beautiful permutations, print any one of them.