Cod sursa(job #172989)

Utilizator mariusake212Isac Marius-Sergiu mariusake212 Data 6 aprilie 2008 23:39:56
Problema Plus Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.46 kb
var
   f:text;
   a1,b1,a2,b2,a3,b3,s,st,i,j,y,k:int64;
begin
     assign(f,'plus.in');reset(f);
     read(f,s);
     read(f,b1,a1);read(f,b2,a2); read(f,b3,a3);
     close(f);
     k:=0;
     for i:=0 to b1 do
         for j:=0 to b2 do
             for y:=0 to b3 do
              begin
              st:=i*a1+j*a2+y*a3;
              if st=s then k:=k+1;
              end;
     assign(f,'plus.out');rewrite(f);
     write(f,k);
     close(f);
end.