其中k为任意质因子,因为a的数值不确定,所有k的值可以任意选择。

以下代码用于求出m!:

#include<bits/stdc++.h>
LL getpow(LL n,LL k)
{
    LL c;
    while(n)
    {
        c+=n/k;
        n/=k;
    }
    return c;///c表示m!
}