Pagini recente » Cod sursa (job #3254182) | Cod sursa (job #3261193) | Cod sursa (job #2357086) | Cod sursa (job #3289902) | Cod sursa (job #800600)
Cod sursa(job #800600)
#include<fstream>
#define MOD 9901
#define LL long long
using namespace std;
ifstream f("sumdiv.in");
ofstream g("sumdiv.out");
LL a,b,k=0,d;
LL e[50],p[50];
inline LL calc(LL a, LL k)
{ LL p=a;
while(--k) p*=a;
return p;
}
int main()
{ f>>a>>b;
if(a==0) {g<<"0\n"; return 0;};
if(a==1) {g<<"1\n"; return 0;};
d=2;
while(d*d<=a)
{
if(a%d==0)
{
e[++k]=0; p[k]=d;
while(a%d==0)
{
e[k]++; a/=d;
}
}
++d;
}
if(a>1) {e[++k]=1; p[k]=a;}
int s=1;
for(int i=1; i<=k; ++i)
s=(s*(calc(p[i],e[i]*b+1)-1)/(p[i]-1))%MOD;
g<<s<<'\n'; g.close();
return 0;
}