Pagini recente » Cod sursa (job #2750628) | Cod sursa (job #3218055) | Cod sursa (job #1893795) | Cod sursa (job #2133031) | Cod sursa (job #251476)
Cod sursa(job #251476)
program alex;
var f:text;
x,n,p:int64;
function putere(x,n:int64):int64;
begin
if n=0 then putere:=1
else if n mod 2=0 then putere:=(sqr(putere(x,n div 2)mod 1999999973))mod 1999999973
else putere:=x*(putere(x,n-1)mod 1999999973)mod 1999999973;
end;
begin
assign(f,'lgput.in');reset(f);
readln(f,x,n);
close(f);
p:=putere(x,n);
assign(f,'lgput.out');rewrite(f);
writeln(f,p);
close(f);
end.