Pagini recente » Cod sursa (job #1260904) | Cod sursa (job #424501) | Cod sursa (job #2901799) | Cod sursa (job #366295) | Cod sursa (job #2836836)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("sumdiv.in");
ofstream fout("sumdiv.out");
const int mod = 9901;
void multSelf(int &x, const int &y) {
x = x * y % mod;
}
int mult(int x, const int &y) {
multSelf(x, y);
return x;
}
int Pow(int x, int n) {
int ans = 1;
while (n) {
if (n & 1) {
ans = mult(ans, x);
}
multSelf(x, x);
n >>= 1;
}
return ans;
}
void testCase() {
int a, b, ans = 1;
fin >> a >> b;
int d = 2;
while (a > 1) {
int e = 0;
while (a % d == 0) {
e += 1;
a /= d;
}
if (e) {
e *= b;
multSelf(ans, mult((Pow(d % mod, e + 1) - 1 + mod) % mod, Pow((d - 1) % mod, mod - 2)));
}
if (d == 2) {
d = 3;
} else {
d += 2;
}
if (d * d > a) {
d = a;
}
}
fout << ans << '\n';
}
int main() {
int tests = 1;
for (int tc = 0; tc < tests; ++tc) {
testCase();
}
fin.close();
fout.close();
return 0;
}