Pagini recente » Cod sursa (job #89892) | Cod sursa (job #1435129) | Cod sursa (job #758656) | Cod sursa (job #1694992) | Cod sursa (job #175085)
Cod sursa(job #175085)
var x,y,z,a,b,c,t:int64;
n,i,j,s:int64;
f,g:text;
procedure citire;
begin
readln(f,x,y,z,a,b,c,n);
end;
procedure iepuri;
var aux:integer;
begin
aux:=z*a+y*b+x*c;
x:=y;
y:=z;
z:=aux;
end;
begin
assign(f,'iepuri.in');
assign(g,'iepuri.out');
reset(f);
rewrite(g);
readln(f,t);
for i:=1 to t do
begin
citire;
for j:=3 to n do iepuri;
writeln(g,z mod 666013);
end;
close(f);
close(g);
end.