Cod sursa(job #84711)

Utilizator toni2007Pripoae Teodor Anton toni2007 Data 16 septembrie 2007 14:58:07
Problema Iepuri Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.41 kb
var t,i:int 32;
    f1,f2:text;
function iepuri(i:int 32):int 32;
var a,b,c,x,y,z,n,v,j:int 32;
begin	
	read(f1,x,y,z,a,b,c,n);
	for j:=3 to n do begin
		v:=a*z+b*y+c*x;
		x:=y;
		y:=z;
		z:=v;
	end;
	iepuri:=v;
end;
begin
	Assign(f1,'iepuri.in');reset(f1);
	Assign(f2,'iepuri.out');rewrite(f2);
	read(f1,t);
	for i:=1 to t do
		writeln(f2,iepuri(i) mod 666013);
	close(f1);
	close(f2);
	
end.