没别的,直接冲,暴力做
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long LL;
int n;
LL f[35];
void init()
{
fill(f, f + 35, 1);
for (int i = 1; i <= 20; i ++ )
f[i] = f[i - 1] * i;
}
void solve()
{
vector<int> v;
for (int i = 2; i <= n / i; i ++ )
{
int p = 0;
while(n % i == 0) p ++, n /= i;
if(p) v.push_back(p);
}
if (n > 1) v.push_back(1);
int res = 0;
LL ans = 1;
for (int i = 0; i < v.size(); i ++ )
{
res += v[i];
ans *= f[v[i]];
}
ans = f[res] / ans;
cout << res << ' ' << ans << endl;
return ;
}
int main()
{
init();
while (cin >> n)
{
solve();
}
return 0;
}