Var
N, Z, sick, day: integer;
begin
sick := 0;
day := 1;
write('Количество жителей: ');
readln(N);
while (day <= 20) and (sick < N) do<br> begin
Z := random(1000);
sick := sick + Z;
if sick > N then sick := N;
writeln(day, ' день - здоровых ', N - sick, ' больных ', sick);
day := day + 1;
end;
end.