In the event of technical difficulties with Szkopuł, please contact us via email at firstname.lastname@example.org.
If you are familiar with IRC chat, the support team is also reachable on PIRC network (
#szkopul channel. If you are not, just use email.
Please do not ask us things like "how to solve task XYZ?".
Please remember that the support team has to sleep sometimes or go to work in real life.
We call a permutation of integers anti-arithmetic, when there are no three-term arithmetic series in this permutation, i.e. there are no such three indices , that integers (in this order) make an arithmetic series. For example the series of integers is an anti-arithmetic permutation of integers . The series is not an anti-arithmetic permutation, because its first, fifth and sixth term: form an arithmetic series (as well as its second, forth and fifth term: and second third and forth term: form arithmetic series).
Write a program that:
There is one positive integer , , written in the standard input.
The standard output should be composed of lines. These lines should contain different integers from the set , one in each line. The numbers in the consecutive lines should form an anti-arithmetic permutation of numbers .
For the input data:
the correct result is:
3 1 0 4 2
Task author: Wojciech Guzicki.