<PREV Problem:
NEXT>
Solved by 405 users: ...
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 

Good permutations

Time limit = 5 second(s)

Memory limit = 8 Mb

There is set Z = {2,3, ..., N, N+1};

The permutation A of Z is called good permutaion, if Ai is divided by i for each i = 1,2, .. N. Output all good permutations.

Input Number N (0 < N ≤ 2000)

Output Your program should output all "good permutations" in any order. Permutations should be divuded by new-line-symbol.

Input#1
4
Output#1
5 2 3 4
Input#2
5
Output#2
6 2 3 4 5
2 6 3 4 5
3 2 6 4 5

Author:
Eugene Barsky
10 April 2004

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 180ms

SW soft NIX
ID = 54.162.181.75