Pagini recente » Cod sursa (job #83432) | Cod sursa (job #848544) | Cod sursa (job #1356763) | aa | Cod sursa (job #653840)
Cod sursa(job #653840)
#include <stdio.h>
long long a,b,c=1999999973,i,j,rez=1;
long long divide(long long a,long long b){
if (b==1)
return a;
else{
if (b%2==0){
long long sol=divide(a,b/2);
return ((sol%c)*(sol%c))%c;
}
else{
long long sol=divide(a,b-1);
return ((sol%c)*(a%c))%c;
}
}
}
int main()
{
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
scanf("%lld %lld", &a, &b);
rez=divide(a,b);
printf("%lld", rez);
return 0;
}