Pagini recente » Cod sursa (job #834059) | Cod sursa (job #1253470) | Istoria paginii runda/concurs24 | Cod sursa (job #408909) | Cod sursa (job #1374357)
program ridicare_la_putere;
const k=1999999973;
var n,p,x:longint;
f,g:text;
procedure pow(p:longint);
begin
if p<>0 then
begin
if p mod 2<>0 then
begin
x:=((x mod k)*(n mod k)) mod k;
pow(p-1);
end
else
begin
n:=((n mod k)*(n mod k)) mod k;
pow(p div 2);
end;
end;
end;
begin
assign(f,'lgput.in'); reset(f);
assign(g,'lgput.out'); rewrite(g);
readln(f,n,p);
x:=1;
pow(p);
writeln(g,x);
close(f);
close(g);
end.