Program Fire;uses crt;var a, b, c, d, e, i, kol: integer;
beginkol:=0;a:=15;b:=15;c:=15;d:=15;randomize;for i:=1 to 60 do begin e:=Abs (random (5) - 1); if e=1 then a:=a-1; if e=2 then b:=b-1; if e=3 then c:=c-1; if e=4 then d:=d-1; if (a=0) or (b=0) or (c=0) or (d=0) then break; kol:=kol+1; end;writeln ('Kolichestvo sgorevshih spichek = ', kol); end.