Cod sursa(job #407143)
Utilizator | sotoc sergiu rathegod | Data | 2 martie 2010 08:50:39 |
---|---|---|---|
Problema | Iepuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include<fstream>
using namespace std;
int main()
{
ifstream f("iepuri.in");
ofstream g("iepuri.out");
int n;
f>>n;
int x,y,z,i;
long a,b,c,ziuaproblema;
for(i=1;i<=n;i++)
{
f>>x>>y>>z>>a>>b>>c>>ziuaproblema;
int zi=2;
int sem=1;
while(zi<ziuaproblema)
{
x=a*z+b*y+c*x;
zi++;
/*if(zi==ziuaproblema)
{
sem=0;
g<<x;
}*/
int aux=x;
x=y;
y=z;
z=aux;
}
g<<(long)(z)%666013<<endl;
}
g.close();
f.close();
return 0;
}