## Anti-arithmetic permutations

## POI III Stage III Problem 4## Anti-arithmetic permutationsWe call a permutation p, ... , _{1}p
of integers 0, 1, ...
, _{n-1}n-1 anti-arithmetic, when there are no three-term
arithmetic series in this permutation, i.e. there are no such three indices
i < j < k, that integers p, _{i} p_{j},
p_{k} make an arithmetic series. For example the series of integers 3, 1,
0, 4, 2 is an anti-arithmetic permutation of integers 0, 1, 2, 3, 4. The series
0, 5, 4, 3, 1, 2 is not an anti-arithmetic permutation, because its first, fifth
and sixth term: 0, 1, 2 form an arithmetic series (as well as its second, forth
and fifth term: 5, 3, 1 and second third and forth term: 5, 4, 3 form arithmetic series).
## TaskWrite a program that: - reads one positive integer
*n*from the text file PER.IN, - computes any anti-arithmetic permutation of numbers 0, 1, ... ,
*n*-1 and writes it into the text file PER.OUT.
## Input
There is one positive integer ## Output
The output file PER.OUT should be composed of ## Example
If there is number 5 written in the input file PER.IN, then one of the correct
solutions is the following file PER.OUT : |