#P6056. [加油武汉] SIR 模型

[加油武汉] SIR 模型

Description

We simplify this model. Initially, there are II infectives and SS susceptibles. For each day, suppose there are currently IiI_i infectives, SiS_i susceptibles, and RiR_i recovered. Then each day, βSiIi\lceil \beta S_iI_i \rceil people will be infected (changing from susceptible to infective), and γIi\lceil \gamma I_i \rceil people will be cured (changing from infective to recovered).

Here, β\beta is the infection rate, γ\gamma is the recovery rate, and  \lceil \ \rceil is the ceiling function.

Find how many susceptibles SS, infectives II, and recovered RR there are after nn 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 00, S0S_0, the number of infectives on day 00, I0I_0, and the number of days nn (initially the number of recovered is R0=0R_0=0).

The second line contains two floating-point numbers, representing the infection rate β\beta and the recovery rate γ\gamma.

Output Format

Output one line with three integers, representing the numbers of susceptibles SS, infectives II, and recovered RR after nn 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 30%30\% of the testdata, n=1n=1. For another 30%30\% of the testdata, S0,R0104S_0, R_0 \le 10^4. For 100%100\% 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