Pagini recente » Cod sursa (job #2899447) | Cod sursa (job #1119124) | Cod sursa (job #1130883) | Cod sursa (job #246587) | Cod sursa (job #1501841)
const mod1=1999999973;
var f:text;
a,b,c:longint;
function putere(x,n:longint):longint;
var p:longint;
begin
if n=0 then putere:=1
else
if n mod 2=0 then
begin
p:=putere(x,n div 2);
putere:=(((p)mod mod1)*((p)mod mod1))mod mod1;
end
else
begin
p:=putere(x,(n-1)div 2);
putere:=(((p)mod mod1)*((p)mod mod1)*((x)mod mod1)) mod mod1
end;
end;
begin
assign(f,'lgput.in');
reset(f);
readln(f,a,b);
close(f);
c:=putere(a,b);
assign(f,'lgput.out');
rewrite(f);
writeln(f,c);
close(f);
end.