Cod sursa(job #21735)
Utilizator | Pop Paul skydome | Data | 24 februarie 2007 10:32:43 |
---|---|---|---|
Problema | Iepuri | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
var f,g:text;
s,q,i,j,x,y,z,a,b,c,n:longint;
begin
assign(g,'iepuri.out');
rewrite(g);
assign(f,'iepuri.in');
reset(f);
readln(f,q);
{for i:=1 to q do
begin }
while not eof(f) do
begin
s:=0;
read(f,x,y,z,a,b,c,n);
for j:=3 to n do
begin
s:=x*a+y*b+c*z;
c:=b;
b:=a;
a:=s;
end;
writeln(g,s mod 666013);
readln(f);
end;
close(f);
close(g);
end.