Pagini recente » Cod sursa (job #1069634) | Cod sursa (job #784771) | Cod sursa (job #834516) | Cod sursa (job #756933) | Cod sursa (job #2336972)
#include <iostream>
#include <fstream>
#include <bitset>
using namespace std;
const int sup=71e2+5;
const int mod=9901;
ifstream fin("sumdiv.in");
ofstream fout("sumdiv.out");
bitset <sup> vis;
int prim[sup];
int tot;
void ciur(){
for (int i=2,j;i<sup;++i){
if (!vis[i]){
prim[++tot]=i;
for (j=i+i;j<sup;j+=i) vis[j]=1;
}
}
}
inline int pow(int a,int b){
a%=mod;
int ret=1;
for (;b;b>>=1){
if (b & 1){
ret*=a;
ret%=mod;
}
a*=a;
a%=mod;
}
return ret;
}
int exp;
long long n;
int e,ans=1;
int main() {
ciur();
fin>>n>>e;
for (int i=1;i<=tot && 1LL*prim[i]*prim[i];++i){
if (n%prim[i]) continue;
exp=0;
while (n%prim[i]==0){
++exp;
n/=prim[i];
}
exp*=e;
int s1 = ( pow ( prim[i] % mod , 1LL*(exp+1)) -1) % mod;
int s2 = pow ( (prim[i] - 1) % mod , mod - 2 ) % mod;
ans = ( ( ( ans * s1 ) % mod ) * s2 ) % mod;
}
if (n>1){
int s1= (pow (n , e+1) - 1) % mod;
int s2= pow ( n-1 , mod-2 ) % mod;
ans=( ( ( ans * s1 ) % mod ) * s2 ) %mod;
}
fout<<ans;
return 0;
}