Write a program to count the number of permutations of with exactly cycles, where .
For instance, of the six permutations of , we have:
two with one cycle, which are: and .
three with two cycles, which are: , and .
one with three cycles, which is: .
Input consists of several cases, each with and , such that .
For every case, count the number of permutations of with cycles. As the result can be very large, make the computations modulo .
Let be the number of cases. The expected solution has total cost . You can get up to 80 points with test cases where , with a solution with cost .