Cod sursa(job #3158075)
Utilizator | Data | 17 octombrie 2023 17:41:05 | |
---|---|---|---|
Problema | Iepuri | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | HLO 2023 - Cls 11-12 - Tema 0 | Marime | 0.48 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int aux, x, y, z, a, b, c, n, t, i, j;
ifstream fin("iepuri.in");
ofstream fout("iepuri.out");
fin>>t;
for(i = 1; i <= t; i++){
fin>>x>>y>>z>>a>>b>>c>>n;
for(j = 3; j <= n; j++){
aux = a*z + b*y + c*x;
x = y;
y = z;
z = aux;
}
fout<<aux%666013<<"\n";
fout.flush();
}
return 0;
}