Cod sursa(job #2563428)
Utilizator | Data | 1 martie 2020 11:30:48 | |
---|---|---|---|
Problema | Iepuri | Scor | 0 |
Compilator | cpp-32 | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<bits/stdc++.h>
using namespace std;
int main()
{
ifstream f("iepuri.in");
ofstream g("iepuri.out");
int t,x,y,z,a,b,c,n,s;
f>>t;
while(t)
{
f>>x>>y>>z>>a>>b>>c>>n;
n=n-2;
while(n)
{
s=a*z+b*y+c*x;
x=y;
y=z;
z=s;
n--;
}
g<<s<<'\n';
t--;
}
return 0;
}