Pagini recente » Cod sursa (job #1626277) | Cod sursa (job #1072037) | Cod sursa (job #2513396) | Cod sursa (job #1126961) | Cod sursa (job #547030)
Cod sursa(job #547030)
#include<fstream>
#define MOD 9901
using namespace std;
ifstream f("sumdiv.in");
ofstream g("sumdiv.out");
int a, b, aa, aux;
long long rez=1;
void Citeste()
{
f>>aa>>b;
aux=aa;
}
long long putere(int b)
{
long long z;
if (b==0) return 1;
if (b==1) return a;
if (b%2==0)
{
z=putere(b/2);
return (z*z)%MOD;
}
else
{
z=putere(b/2);
return (z*z*a)%MOD;
}
}
long long suma(int b)
{
long long p, z;
if (b==0) return 1;
if (b%2==1)
{
p=putere((b+1)/2);
z=suma(b/2);
return (((z*p)%MOD)+z)%MOD;
}
else
{
p=putere(b);
z=suma(b-1);
return (z+p)%MOD;
}
}
void Solve()
{
int d=2;
a=2;
while (aa%2==0)
{
rez=(rez*suma(b))%MOD;
aa/=2;
}
d=3;
while (d*d<=aux)
{
a=d;
while (aa%d==0)
{
rez=(rez*suma(b))%MOD;
aa/=d;
}
d+=2;
}
if (aa!=1) a=aa, rez=(rez*suma(b))%MOD;
}
void Afiseaza()
{
g<<rez<<"\n";
}
int main()
{
Citeste();
Solve();
Afiseaza();
f.close();
g.close();
return 0;
}