Pagini recente » Cod sursa (job #2350883) | Cod sursa (job #2469484) | Cod sursa (job #1042958) | Cod sursa (job #1876040) | Cod sursa (job #2113018)
#include <fstream>
using namespace std;
ifstream fin ("sumdiv.in");
ofstream fout ("sumdiv.out");
typedef unsigned long long ULL;
int MOD=9901;
ULL put(ULL a,ULL b)
{
if(b==0)return 1;
if(b==1)return a;
ULL aux=put(a,b/2);
if(b&1)return ((aux*aux)%MOD*a)%MOD;
return (aux*aux)%MOD;
}
ULL a,b,n=1,s=1;
int i,d,p;
int main()
{
fin>>a>>b;
n=put(a,b);
d=2;
while(n>1)
{ p=0;
while(n%d==0){n=n/d;
++p;}
if(p)s*=(put(d,p+1)-1)/(d-1);
s=s%MOD;
++d;
if(d*d>n)d=n;
}
fout<<s;
fin.close(); fout.close();
return 0;
}