P29305 [洛谷] [Come on, Wuhan] SIR Model
普及-
题目描述

Problem Background

The SIR model divides the total population into the following three categories:

  • Susceptibles, denoted as $s(t)$, representing the number of individuals who are not infected but are susceptible to the disease at time $t$;
  • Infectives, denoted as $i(t)$, representing the number of individuals who are infected and capable of transmitting the disease at time $t$;
  • Recovered, denoted as $r(t)$, representing the number of individuals who have been removed from the infected category at time $t$.

Let the total population be $N(t)$, then we have $N(t) = s(t) + i(t) + r(t)$.

The SIR model is based on the following three assumptions:

  1. The population dynamics factors such as births, deaths, and migrations are not considered. The population remains constant, i.e., $N(t) \equiv K$.
  2. An infected individual will inevitably have a certain level of infectivity upon contact with a susceptible. Assuming that at time $t$, the number of susceptibles infected by a single infected individual within a unit time is proportional to the total number of susceptibles $s(t)$ in the environment, with the proportional coefficient being $\beta$. Thus, the number of individuals infected by all infected individuals within a unit time at time $t$ is $\beta s(t)i(t)$.
  3. At time $t$, the number of individuals removed from the infected category within a unit time is proportional to the number of infected individuals, with the proportional coefficient being $\gamma$, and the number of removed individuals within a unit time is $\gamma i(t)$.

Problem Description

We simplify this model, starting with $I$ infected individuals and $S$ susceptible individuals. For each day, there are $I_i$ infected individuals, $S_i$ susceptible individuals, and $R_i$ recovered individuals. Each day, $\lceil \beta S_iI_i \rceil$ individuals will be infected (from susceptible to infected), and $\lceil \gamma I_i \rceil$ individuals will be cured (from infected to recovered).

Here, $\beta$ is the infection coefficient, $\gamma$ is the recovery coefficient, and $\lceil \rceil$ denotes the ceiling function.

Determine the number of susceptible individuals $S$, infected individuals $I$, and recovered individuals $R$ after $n$ days.

Note: Both infected and recovered individuals are calculated daily, and the results are only related to the values at the beginning of the day. That is, the recovery of infected individuals on the same day does not affect their ability to infect others.

If the number of individuals infected exceeds the number of susceptible individuals, then all susceptible individuals will be infected.

Input Format

The first line contains three positive integers, representing the number of susceptible individuals $S_0$, the number of infected individuals $I_0$, and the number of days $n$ on day 0 (initially, the number of recovered individuals $R_0 = 0$).

The second line contains two floating-point numbers, representing the infection coefficient $\beta$ and the recovery coefficient $\gamma$.

Output Format

A single line containing three integers, representing the number of susceptible individuals $S$, the number of infected individuals $I$, and the number of recovered individuals $R$ after $n$ days.

Sample Input and Output

Sample Input #1

980 20 2
0.0005 0.00001

Sample Output #1

955 43 2

Sample Input #2

1400000000 1 10
0.000000003 0.001

Sample Output #2

1386791252 13205592 3157

Sample Input #3

1919 810 1
0.00001 0.1

Sample Output #3

1903 745 81

Notes

For 30% of the data, $n = 1$.
For another 30% of the data, $S_0, R_0 \leq 10^4$.
For 100% of the data, $1 \leq S_0 + R_0 \leq 2 \times 10^9$, $0 < \beta, \gamma < 1$, $1 \leq n \leq 100$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
980 20 2 0.0005 0.00001
样例输出
955 43 2