Pagini recente » Cod sursa (job #2481532) | Cod sursa (job #2918791) | Cod sursa (job #595978) | Cod sursa (job #2216116) | Cod sursa (job #1183748)
#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;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=(((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=(((suma*p1)op)*p2)op;
}
else
suma=(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=(rez*x)op;
}
x=(x*x)op;
}
return rez op;
}