In this problem, we will say that a permutation is cool is it does not have two adjacent consecutive numbers. Given , print all the cool permutations of .
input consists of several cases, each with an between 1 and 9.
For every case, print in lexicographical order all the cool permutations of . Print a line with 20 asterisks at the end of every case.
Author: Unknown
Translator: Salvador Roura
Generation: 2026-01-25T11:06:42.554Z
© Jutge.org, 2006–2026.
https://jutge.org