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