Mai intai trebuie sa te autentifici.
Cod sursa(job #3158082)
Utilizator | Data | 17 octombrie 2023 17:50:47 | |
---|---|---|---|
Problema | Iepuri | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | HLO 2023 - Cls 11-12 - Tema 0 | Marime | 0.51 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
unsigned long long int goku, x, y, z;
int 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++){
goku = a*z + b*y + c*x;
x = y;
y = z;
z = goku;
}
fout<<goku%666013<<"\n";
fout.flush();
}
return 0;
}