|
||||||||||
PermutationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1014 Accepted Submission(s): 613 Problem Description There is an arrangement of N numbers and a permutation relation that alter one arrangement into another. For example, when N equals to 6 the arrangement is 123456 at first. The replacement relation is 312546 (indicate 1->2, 2->3, 3->1, 4->5, 5->4, 6->6, the relation is also an arrangement distinctly). After the first permutation, the arrangement will be 312546. And then it will be 231456. In this permutation relation (312546), the arrangement will be altered into the order 312546, 231456, 123546, 312456, 231546 and it will always go back to the beginning, so the length of the loop section of this permutation relation equals to 6. Your task is to calculate how many kinds of the length of this loop section in any permutation relations. Input Input contains multiple test cases. In each test cases the input only contains one integer indicates N. For all test cases, N<=1000. Output For each test case, output only one integer indicates the amount the length of the loop section in any permutation relations. Sample Input
Sample Output
Author HIT Source | ||||||||||
|