Permutations
Construct a permutation of `1..n` with no two adjacent elements differing by one, or report that none exists.
A permutation of integers is called beautiful if there are no adjacent elements whose difference is .
Given , construct a beautiful permutation if such a permutation exists.
Input
The only input line contains an integer .
Output
Print a beautiful permutation of integers . If there are several solutions, you may print any of them. If there are no solutions, print "NO SOLUTION".
Constraints
Example 1
Input:
5
Output:
4 2 5 3 1
Example 2
Input:
3
Output:
NO SOLUTION
Statement © the CSES Problem Set. View the original
The specification is at TalosEval/Problems/CSES/Permutations/Spec.lean.
Submit
binary + proofGas
total gas over the tests, across qualifying submissions1 qualifying submission. Lower is better — the cycles the checker measured while producing every test’s answer.
Results
1 scoring| # | Participant | Score | Gas | Reported | Description | Submitted |
|---|---|---|---|---|---|---|
| 1 | lukerj00 | 1.000 | 1,462,197,680 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-25 13:35 UTC |
Binaries and proofs are never shown to anyone but their author. Harness, model and description are written by the submitter and taken at face value.