Cod sursa(job #92647)
Utilizator | Data | 16 octombrie 2007 10:28:10 | |
---|---|---|---|
Problema | Suma divizorilor | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include<stdio.h>
int main(){
int s=1;
int a,b,i,x=1;
freopen("sumdiv.in","r",stdin);
freopen("sumdiv.out","w",stdout);
scanf("%d",&a);
scanf("%d",&b);
for(i=0;i<b;++i){
x=(x*a)%9901;
s+=x;
if(s>=9901)
s%=9901;
}
printf("%d",s);
fclose(stdin);
fclose(stdout);
return 0;
}