Cod sursa(job #844487)
| Utilizator | Data | 29 decembrie 2012 13:26:13 | |
|---|---|---|---|
| Problema | Iepuri | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | 23dezile_2 | Marime | 0.56 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("iepuri.in");
ofstream g("iepuri.out");
int main()
{
long n,a,b,c,x,y,z,t;
f>>t;
for(int i=1;i<=t;i++)
{
int nr_iep=0;
f>>x>>y>>z>>a>>b>>c>>n;
for(int j=3;j<=n;j++)
{
nr_iep=z*a+y*b+x*c;
x=y;
y=z;
z=nr_iep;
}
g<<nr_iep%666013<<"\n";
}
f.close();
g.close();
return 0;
}
