题目
思路
代码
#include<iostream>
#include<cstdio>
using namespace std;
const long long mod=9901;
long long a,b,now,ans=1;
long long ksm(long long x,long long y)
{
long long js=1;
while(y)
{
if(y&1)
js=(js*x)%mod;
x=(x*x)%mod;
y>>=1;
}
return js;
}
long long solve(long long p,long long c)
{
if(!c)
return 1;
if(c&1)
return solve(p,(c-1)/2)*(ksm(p,(c+1)/2)+1)%mod;
else
return (solve(p,c-1)+ksm(p,c))%mod;
}
int main()
{
scanf("%lld%lld",&a,&b);
for(long long f=2; f*f<=a; f++)
{
while(a%f==0)
a/=f,now++;
if(now)
ans=ans*solve(f,now*b)%mod;
now=0;
}
if(a!=1)
ans=ans*solve(a,b)%mod;
printf("%lld",ans);
return 0;
}