| University of Science and Technology of China Freshman Programming Contest 2026(2026 Kruskal Cup) |
|---|
| Finished |
You are given an integer $$$n$$$, an integer $$$k$$$, and an integer $$$p$$$.
Consider all functions $$$$$$ f:\{1,2,\ldots,n\}\to\{1,2,\ldots,n\}. $$$$$$
Let $$$f^k$$$ denote the $$$k$$$-fold iteration of $$$f$$$. If $$$x \in \{1, 2, \dots, n\}$$$ satisfies $$$f^k(x) = x$$$, then $$$x$$$ is called a fixed point of $$$f^k$$$.
Find the number of functions $$$f$$$ that have exactly $$$p$$$ fixed points under $$$f^k$$$. Output the answer modulo $$$10^9+7$$$.
Each test contains multiple test cases.
The first line contains an integer $$$T$$$ $$$(1\le T\le10^4)$$$, the number of test cases.
Each of the next $$$T$$$ lines contains three integers $$$n,k,p$$$ $$$(1\le n,k\le10^6,\ 0\le p\le n)$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^6$$$.
For each test case, output one integer on a separate line, denoting the answer modulo $$$10^9+7$$$.
73 2 22 1 03 1 03 2 03 3 34 2 44 1 2
1218231054
| Name |
|---|


