#P6056. [加油武汉] SIR 模型
[加油武汉] SIR 模型
Background
The SIR model divides the total population into the following three categories:
- Susceptibles, denoted as , representing the number of people at time who are not infected but may be infected by this disease.
- Infectives, denoted as , representing the number of people at time who have been infected, are patients, and are contagious.
- Recovered, denoted as , representing the number of people at time who have been removed from the infectives group.
Let the total population be , then .
The SIR model is built based on the following three assumptions:
- Population dynamics such as births, deaths, and migration are not considered. The population always remains a constant, i.e., .
- Once a patient comes into contact with susceptibles, they will certainly have some infectiousness. Assume that at time , within one unit of time, the number of susceptibles that one patient can infect is proportional to the total number of susceptibles in the environment , with proportionality coefficient . Therefore, at time , within one unit of time, the number of people infected by all patients is .
- At time , within one unit of time, the number of people removed from the infectives group is proportional to the number of patients, with proportionality coefficient . The number of removed people within one unit of time is .
Problem Description
We simplify this model. Initially, there are infectives and susceptibles. For each day, suppose there are currently infectives, susceptibles, and recovered. Then each day, people will be infected (changing from susceptible to infective), and people will be cured (changing from infective to recovered).
Here, is the infection rate, is the recovery rate, and is the ceiling function.
Find how many susceptibles , infectives , and recovered there are after days.
Note: Infectives and recovered are settled daily, and the result depends only on the values at the start of that day. That is, someone who recovers on that day does not affect how many people they infect on the same day.
If the computed number of newly infected people exceeds the number of susceptibles, then all susceptibles become infected.
Input Format
The first line contains three positive integers, representing the number of susceptibles on day , , the number of infectives on day , , and the number of days (initially the number of recovered is ).
The second line contains two floating-point numbers, representing the infection rate and the recovery rate .
Output Format
Output one line with three integers, representing the numbers of susceptibles , infectives , and recovered after days.
980 20 2
0.0005 0.00001
955 43 2
1400000000 1 10
0.000000003 0.001
1386791252 13205592 3157
1919 810 1
0.00001 0.1
1903 745 81
Hint
For of the testdata, . For another of the testdata, . For of the testdata, $1 \le S_0+R_0 \le 2\times 10^9, 0 < \beta, \gamma < 1, 1 \le n \le 100$.
Translated by ChatGPT 5