The question rate of this question is not very high, only less than 30%, the number is very big, it looks scary,
Because k and n are very large, it is impossible to calculate the number of combinations. Therefore, we need to first calculate the number of approx, because the number of combinations is actually in the form of formulas that can be written as factorial, we must first perform prime factor decomposition on the factorial.
1. Check the data range of the question and select a Prime Number of less than 500.
2. Then, we perform prime factor decomposition on every factorial.
3. Find the prime factor decomposition of the combination, and then you can get the number of approx;
# Include
# Include
# Include
# Include
# Include
# Include
# Include
# Include
# Include
# Include
# Include
# Include
# Define ll long # define eps 1e-8 # define inf 0 xfffffffconst ll INF = 1ll <61; using namespace std; // vector
> G; // typedef pair
P; // vector
>:: Iterator iter; // map
Mp; // map
: Iterator p; // bool vis [502]; int a [102], cnt; int divide [502] [102]; ll ans [502] [502]; void clear () {memset (divide, 0, sizeof (divide); memset (ans, 0, sizeof (ans); memset (vis, false, sizeof (vis); memset (a, 0, sizeof (a); cnt = 0;} void init () {clear (); vis [0] = vis [1] = false; for (int I = 2; I <500; I ++) {if (! Vis [I]) a [cnt ++] = I; for (int j = 0; j
> N> k) {if (k = 0 | n = k) {puts ("1"); continue;} cout <