Cod sursa(job #3158079)

Utilizator andrei76Diaconescu Andrei andrei76 Data 17 octombrie 2023 17:48:51
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 aux, 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++){
            aux = a*z + b*y + c*x;
            x = y;
            y = z;
            z = aux;
        }
        fout<<aux%666013<<"\n";
        fout.flush();
    }
    return 0;
}