Pagini recente » Rating Mihnea (MogoneaM) | Statistici Andrei Sorina-Maria (sorina-maria.andrei) | Cod sursa (job #2183079) | Cod sursa (job #533089) | Cod sursa (job #200970)
Cod sursa(job #200970)
#include <cstdio>
const long long ND = 1000;
long long a, b, nd, d[ND], e[ND];
long long f ( long long a, long long b ) {
long long r = 1;
for (long long i = b, x = a; i; i /= 2) {
if (i % 2 == 1)
r = (r*x)%9901;
x = (x*x)%9901;
}
return r;
}
long long main() {
freopen("sumdiv.in","rt",stdin);
freopen("sumdiv.out","wt",stdout);
scanf("%lld %lld",&a,&b);
long long x = a;
for (long long i = 2; i*i < x; ++i) {
if (x%i == 0) {
d[nd] = i;
for (e[nd] = 0; x % i == 0; x /= i) ++e[nd];
e[nd] *= b;
++nd;
}
}
if (x > 1) {
d[nd] = x;
e[nd] = b;
++nd;
}
long long r = 1;
for (long long i = 0; i < nd; ++i) {
if (d[i] % 9901 == 1) {
x = e[i]+1;
} else {
x = (f(d[i],e[i])*d[i]+9900)%9901;
x = (x*f(d[i]-1,9899))%9901;
}
r = (r*x)%9901;
}
printf("%lld\n",r);
return 0;
}