Pagini recente » Cod sursa (job #1093908) | Cod sursa (job #1799636) | Istoria paginii runda/warmup/clasament | Cod sursa (job #1568254) | Cod sursa (job #1386245)
program putere;
const c=1999999973;
var x,n:longint;
f,g:text;
function putere(x,n:longint):longint;
begin
if n=0 then putere:=1
else if n=1 then putere:=x
else if n mod 2 = 1 then
putere:=((x mod c)*(putere(x,n-1) mod c))mod c
else
putere:=putere(((x mod c)*(x mod c))mod c,n div 2)
end;
begin
assign(f,'lgput.in'); reset(f);
assign(g,'lgput.out'); rewrite(g);
readln(f,x,n);
writeln(g,putere(x,n)mod c);
close(f); close(g);
end.