Pagini recente » Cod sursa (job #2564328) | Cod sursa (job #1409410) | Cod sursa (job #1242847) | Cod sursa (job #1201444) | Cod sursa (job #152409)
Cod sursa(job #152409)
var n,p:longword;
const mare=1999999973;
procedure citire;
var f:text;
begin
assign(f,'lgput.in');
reset(f);
readln(f,n,p);
close(f);
end;
procedure scrie(k:longword);
var f:text;
begin
assign(f,'lgput.out');
rewrite(f);
writeln(f,k);
close(f);
end;
function put(k,x:longint):longword;
var t:longword;
begin
if x=1 then
put:=k mod mare
else
begin
t:=put(k,x div 2);
if x mod 2 =0 then
put:=t*t mod mare
else
put:=t*t*put(k,1) mod mare;
end;
end;
begin
citire;
scrie(put(n,p));
end.