Pagini recente » Monitorul de evaluare | Cod sursa (job #478972) | Cod sursa (job #3340765) | Cod sursa (job #3263140) | Cod sursa (job #3322981)
#include <bits/stdc++.h>
using namespace std;
const int MOD = 9901;
int pow_mod( int p, int e ) {
int rez = 1;
while ( e > 0 ) {
if ( e % 2 == 1 )
rez = ((long long)rez * p) % MOD;
p = ((long long)p * p) % MOD;
e /= 2;
}
return rez;
}
int main() {
FILE *fin, *fout;
int a, b, ans, i, e;
fin = fopen( "sumdiv.in", "r" );
fscanf( fin, "%d%d", &a, &b );
fclose( fin );
ans = 1;
for ( i = 2; i * i <= a; i++ ) {
if ( a % i == 0 ) {
e = 0;
while ( a % i == 0 ) {
e++;
a /= i;
}
ans = ans * ((pow_mod( i, e * b + 1 ) + MOD - 1) * pow_mod( i - 1, MOD - 2 ) % MOD) % MOD;
}
}
if ( a > 1 )
ans = ans * ((pow_mod( a, b + 1 ) + MOD - 1) * pow_mod( a - 1, MOD - 2 ) % MOD) % MOD;
fout = fopen( "sumdiv.out", "w" );
fprintf( fout, "%d\n", ans );
fclose( fout );
return 0;
}