Pagini recente » Clasament proba_pregatire_ioit | Cod sursa (job #145931) | Cod sursa (job #2103846) | Atasamentele paginii Profil MAlexandru | Cod sursa (job #166633)
Cod sursa(job #166633)
var a,b:int64;
f,g:text;
function put(a,b:int64):int64;
var r:qword;
begin
if b=0 then put:=1
else
if b and 1=1 then
put:=(a*put(a,b-1)) mod 1999999973
else begin
r:=put(a,b shr 1);
put:=(r*r) mod 1999999973;
end;
end;
begin
assign(f,'lgput.in'); reset(f);
assign(g,'lgput.out'); rewrite(g);
read(f,a,b);
writeln(g,put(a,b));
close(f); close(g);
end.