Cod sursa(job #1346194)
Utilizator | Data | 18 februarie 2015 08:34:55 | |
---|---|---|---|
Problema | Iepuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <fstream>
using namespace std;
ifstream f("iepuri.in");
ofstream g("iepuri.out");
int main()
{
int x,y,z,a,b,c,n,t,i,aux;
f>>t;
while(t){
f>>x>>y>>z>>a>>b>>c>>n;
for(i=3;i<=n;i++)
{aux=z;
z=a*x+b*y+c*z;x=y;y=aux;
}g<<z%666013<<endl;t--;}
return 0;
}