Pagini recente » Cod sursa (job #3262151) | Cod sursa (job #226996) | Cod sursa (job #2531082) | Cod sursa (job #1269194) | Cod sursa (job #1128000)
program putere;
var fi,fo:text;
n,p,m:int64;
function exp(p:int64):int64;
var aux:int64;
begin
if p=0 then exp:=1
else
begin
aux:=exp(p shr 1) mod m;
aux:=(aux*aux)mod m;
if p and 1=1 then exp:=(aux*n) mod m
else exp:=aux;
end;
end;
begin
assign(fi,'lgput.in'); reset(fi);
assign(fo,'lgput.out'); rewrite(fo);
read(fi,n,p);
m:=1999999973;
n:=n mod m;
writeln(fo,exp(p));
close(fi);
close(fo);
end.