Cod sursa(job #158768)
Utilizator | Data | 13 martie 2008 20:14:57 | |
---|---|---|---|
Problema | Iepuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include<fstream.h>
ifstream f("iepuri.in");
ofstream g("iepuri.out");
long t,a,b,c,i,j;
long p[10000],n;
int main()
{
for(i=0;i<t;i++)
{f>>p[0]>>p[1]>>p[2]>>a>>b>>c>>n;
for(j=3;j<=n;j++)
p[j]=a*p[j-1]+b*p[j-2]+c*p[j-3];
g<<p[n]%666013<<"\n";
}
f.close();
g.close();
return 0;
}