详解:http://blog.csdn.net/lyy289065406/article/details/6648539
#include <cstring>
#include<iostream>
using namespace std;
using namespace std;
typedef long long int LL;
#define maxn 100005
#define mod 9901
LL a[maxn];
LL b[maxn];
LL n , m;
LL qpow(LL a , int b)
{
LL res = 1;
for(int i = b ; i ; i>>= 1,(a = a*a%mod))
if( i&1 )res=a*res%mod;
return res;
}
LL cal(LL p , LL k)
{
if( k == 0 )
return 1;
if( k % 2 )//偶数个
return (cal(p,k/2)*(1+qpow(p,k/2+1)))%mod;
else
return (cal(p,k/2-1)*(1+qpow(p,k/2+1))+qpow(p,k/2))%mod;
}
void deal()
{
int k = 0;
for(int i = 2 ; i*i <= n ; )
{
if( n % i == 0 )
{
a[k] = i;
b[k] = 0;
while( n % i == 0 )
{
b[k]++;
n /= i;
}
k++;
}
if( i == 2 )i++;
else i += 2;
}
if( n != 1 )a[k] = n,b[k++] = 1;
LL ans = 1;
for(int i = 0 ; i < k ; ++i)
{
LL tmp = cal( a[i] , b[i]*m );
ans = (tmp%mod * ans%mod)%mod;
}
cout << ans << endl;
}
int main()
{
while( cin >> n >> m ){
deal( );
}
}