Pagini recente » Cod sursa (job #2140853) | Cod sursa (job #729568) | Cod sursa (job #1279873) | Cod sursa (job #990174) | Cod sursa (job #208484)
Cod sursa(job #208484)
#include <stdio.h>
#include <math.h>
long long n, x, y, i, j, a[1000], b[1000];
long long s, s2, z;
long long proc(long long x, long long y) {
long long t = 1;
for (long k = y; k > 0; k >>= 1) {
if (k % 2 == 1) {
t = (t * x) % 9901;
}
x = (x * x) % 9901;
}
return t;
}
int main() {
freopen("sumdiv.in", "r", stdin);
freopen("sumdiv.out", "w", stdout);
scanf("%lld %lld", &x, &y);
for (i = 2; i * i <= x; ++i) {
if (x % i > 0) {
continue;
}
a[++n] = i;
while (x % i == 0) {
x /= i;
++b[n];
}
}
if (x > 1) {
a[++n] = x;
b[n] = 1;
}
s = 1;
for (i = 1; i <= n; ++i) {
b[i] *= y;
if (a[i] % 9901 == 1) {
z = b[i]+1;
} else {
z = (proc(a[i], b[i]) * a[i] + 9900) % 9901;
z = (z *proc(a[i] - 1, 9901 - 2)) % 9901;
}
s = (s * z) % 9901;
}
printf("%lld\n", s);
return 0;
}