Cod sursa(job #2043416)
Utilizator | Data | 19 octombrie 2017 23:07:23 | |
---|---|---|---|
Problema | Iepuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include<fstream>
using namespace std;
ifstream f("iepuri.in");
ofstream g("iepuri.out");
int main()
{
long long i,x,y,z,a,b,c,n,t,u,j;
f>>t;
for(i=1;i<=t;i++){
f>>x>>y>>z>>a>>b>>c>>n;
for(j=1;j<=n-2;j++){
u=a*z+b*y+c*x;
x=y;
y=z;
z=u;
}
g<<z<<"\n";
}
f.close();
g.close();
return 0;
}