Pagini recente » Cod sursa (job #2569704) | Cod sursa (job #1356220) | Cod sursa (job #619377) | Cod sursa (job #1976652) | 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.