Pagini recente » Cod sursa (job #1214283) | Cod sursa (job #1436451) | Cod sursa (job #2565670) | Cod sursa (job #2350582) | Cod sursa (job #876583)
Cod sursa(job #876583)
program test;
var a:array[1..100] of qword;
x,n,p:qword;
f,g:text;
begin
assign(f,'lgput.in');reset(f);
assign(g,'lgput.out');rewrite(g);
readln(f,n,p);
x:=1;
while p<>1 do
begin
if p mod 2=0 then begin
n:=n*n mod 1999999973;
p:=p div 2;
end
else begin
x:=x*n mod 1999999973;
dec(p);
end;
end;
x:=x*n;
writeln(g,x mod 1999999973);
close(f); close(g);
end.