You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
640 B
C++
30 lines
640 B
C++
#include <cstdio>
|
|
int f[1 << 12 | 1];
|
|
long long _f(int x)
|
|
{
|
|
long long ans = 1;
|
|
for (int i = x; i; i--) ans *= i;
|
|
return ans;
|
|
}
|
|
int main()
|
|
{
|
|
int x;
|
|
while (~scanf("%d", &x))
|
|
{
|
|
int _x = x, t = 0;
|
|
for (int i = 2; i * i <= _x; i++)
|
|
{
|
|
f[t] = 0;
|
|
while (_x % i == 0)
|
|
_x /= i, f[t]++;
|
|
t++;
|
|
}
|
|
if (_x != 1) f[t++] = 1;
|
|
int sum = 0;
|
|
for (int i = 0; i < t; i++) sum += f[i];
|
|
long long fac = _f(sum);
|
|
for (int i = 0; i < t; i++) fac /= _f(f[i]);
|
|
printf("%d %lld\n", sum, fac);
|
|
}
|
|
return 0;
|
|
} |