Pagini recente » Cod sursa (job #181097) | Cod sursa (job #872604) | Cod sursa (job #1546914) | Cod sursa (job #1489505) | Cod sursa (job #2642731)
#include <fstream>
using namespace std;
const int MOD = 1999999973;
ifstream f("sumadiv.in");
ofstream g("sumadiv.out");
int putere(int x, int y)
{
int rez = 1;
while (y)
{
if (y % 2) rez = (1LL * rez * x) % MOD;
x = (1LL * x * x) % MOD;
y /= 2;
}
return rez;
}
int main()
{
int a, b, x,s=0;
f >> a >> b;
x = putere(a, b);
for (int i = 1; i * i <= x; i++)
if (!(x % i))
{
s += i;
int j = x / i;
if (i != j) s += j;
}
g << s % 9901;
f.close(); g.close();
}