Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: The shuffle Problem
Description Any case of shuffling of n cards can be described with a permutation of 1 to n. Thus there are totally Before shuffling：1, 2, 3, 4, 5 You'll find that after six shuffles, the cards' order returns the beginning. In fact, there is always a number Input The first line of the input is an integer Output Each test case takes a line, with an integer Sample Input 2 1 5 Sample Output 1 1 6 2 1 4 5 3 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator