约数之和

题意:
思路:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = 9901;
int cnt;
int pri[1000010];
int vis[1000010];
int ans[1000010];
int num[1000010];
ll qpow(ll a,ll b)
{
ll res = 1;
while(b)
{
if(b%2)res = res*a%mod;
b = b>>1;
a = a*a%mod;
}
return res;
}
void oula()
{
for(int i = 2; i <= 1000000; i++)
{
if(!vis[i])pri[++cnt] = i;
for(int j = 1; j <= cnt && pri[j]*i <= 1000000; j++)
{
vis[i*pri[j]] = 1;
}
}
}
int main()
{
__int128 p;
oula();
ll a,b;
cin>>a>>b;
if(a == 0)
{
cout<<0<<endl;
return 0;
}
int c = 0,now = a;
for(int i = 1; i <= cnt; i++)
{
now = a;
if(pri[i] > now)break;
if(now%pri[i] == 0)ans[++c] = pri[i];
while(now%pri[i]==0)
num[c]++,now/=pri[i];
}
ll res = 1;
for(int i = 1; i <= c; i++)
{
if((qpow(ans[i],b*num[i]+1)+mod-1)%mod != 0)
res *= (qpow(ans[i],b*num[i]+1)+mod-1)%mod*qpow(ans[i]-1,mod-2)%mod;
else res*=(num[i]*b+1)%mod;
res%=mod;
}
cout<<(res)%mod<<endl;
}