409980: GYM103886 G Vacation
Description
Ariel is on a vacation where he must visit $$$n$$$ locations famous for their cereal, numbered $$$1 \dots n$$$.
He will visit all the locations in some order, where the $$$i$$$th location he visits is $$$a_i$$$.
Therefore, his order of visiting locations forms a permutation of length $$$n$$$. Note that a permutation of length $$$n$$$ is a sequence containing every number from $$$1 \dots n$$$ exactly once.
Ariel thinks an amazing permutation is one where there are no indices $$$(i, j, k)$$$ where ($$$1 \le i < j < k \leq n$$$) such that $$$j - i = k - j$$$ and $$$a_j - a_i = a_k - a_j$$$.
Find a permutation of $$$1 \dots n$$$ that satisfies this (the $$$i$$$th number is the $$$i$$$th location Ariel visits).
InputA single integer $$$n$$$ ($$$1 \leq n \leq 1000$$$).
OutputA single line containing a space separated permutation of $$$1 \dots n$$$ such that Ariel has an amazing vacation.
Any output satisfying the above constraints will be accepted.
ExamplesInput4Output
1 2 4 3Input
10Output
10 1 7 8 2 4 9 5 6 3Note
If we take the first sample case output, no three indices validate the above condition.
For example, if $$$(i, j, k)$$$ = $$$(1, 2, 4)$$$, $$$2 - 1 \neq 4 - 2$$$.
Another example would be $$$(i, j, k)$$$ = $$$(1, 2, 3)$$$. Although, $$$j - i = k - j$$$ since $$$2 - 1 = 3 - 2$$$, $$$a_j - a_i \neq a_k - a_j$$$ since $$$4 - 2 \neq 2 - 1$$$.
Problem Credits: Ariel Shehter