Pagini recente » Cod sursa (job #2074734) | Cod sursa (job #642208) | Cod sursa (job #1790776) | Cod sursa (job #2967609) | Cod sursa (job #1183749)
#include <cstdio>
#include <cmath>
#define op %9901
using namespace std;
int pow(int x,int y);
int main()
{
int fact,a,b;
freopen("sumdiv.in","r",stdin);
freopen("sumdiv.out","w",stdout);
scanf("%d%d",&a,&b);
int suma=1;
for(int j=2;1LL*j*j<=a;++j){
if(a%j)continue;
int fact=0;
while(a%j==0){
fact+=b;
a/=j;
}
int p1=(pow(j,fact+1)-1 + 9901)op;
int p2=pow(j-1,9899)op;
suma=(((1LL*suma*p1)op)*p2)op;;
}
if(a>1){
if(a op!=1){
int p1 =(pow(a,b+1)-1+9901)op;
int p2 =(pow(a-1,9899))op;
suma=(((1LL*suma*p1)op)*p2)op;
}
else
suma=(1LL*suma*(b+1))op;
}
printf("%d\n",suma op);
return 0;
}
int pow(int x,int y){
int rez;
for(rez=1;y;y>>=1){
if(y&1){
rez=(1LL*rez*x)op;
}
x=(1LL*x*x)op;
}
return rez op;
}