<PREV Problem:
NEXT>
Solved by 405 users: ...
UserDateAttemptTimeCMSC
UlyaNick21 mar 2009Ruby104.0893 
bush11 mar 2006Ruby104.81102 
mikl21 aug 2007C++600.71104 
Ra16bit27 feb 2008FPC104.80109 
pverutin07 feb 2008FPC204.88111 
mikleb30 oct 2006C++800.45112 
mikl21 aug 2007C++300.70113 
Artur04 jan 2009Kylix404.75114 
proglamer15 mar 2006C++500.49118 
MasterYoda23 jun 2009C++500.44120 
Artur04 jan 2009C600.44120 
pradeepr_ceg09 jun 2006C700.45120 
MasterYoda23 jun 2009C++400.44122 
Languages
C++
221
FPC
96
C
48
Kylix
23
Java
20
Ruby
7
Perl
1
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

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 200ms

SW soft NIX
ID = 75.101.220.230