Cod sursa(job #581425)
Utilizator | Data | 14 aprilie 2011 10:17:08 | |
---|---|---|---|
Problema | Iepuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <fstream>
using namespace std;
ifstream fin("iepuri.in");
ofstream fout("iepuri.out");
int x,y,z,t,a,b,c,n,temp;
int main()
{ fin>>t;
while(t>0)
{
fin>>x>>y>>z>>a>>b>>c>>n;
for(int i=3;i<=n;i++)
{ temp=z; z=z*a+y*b+c*x; x=y; y=temp; }
fout<<z<<"\n";
t--;
}
}