-->
当前位置:首页 > 题库

PROGRAMMING:Yet Another Infectious Virus

Luz5年前 (2021-05-10)题库395
Nowadays, there is a widely spreading infectious pandemic disease named Coronavirus, which greatly influences all the aspects of our daily life.
From the latest official statistics, the number of people who diagnosed with 2019-nCoV reaches 3834512 worldwide, while the number of deaths caused by 2019-nCoV attains to 267887 until May 8th, 2020. Here shows the picture of it:  

![ Wechat pictures_ 20200522161913.png](~/49b047e8-0117-48c2-a752-df7687fad069.png)
In recent years, with the development of the technology and the eruption of some kinds of infectious diseases such as HIV, SARS, H1N1, H5N7 for research. Scientists have already established some Infectious Disease Models within accuracy. One of these models that seems quite suitable to the changing trend of Coronavirus is called SIS model.
The SIS model assumes that:
1. The population at time $$t$$ is divided into susceptible people (proportion of the total number of people $$s(t)$$) and infected people (proportion of the total number of people $$i(t)$$).
2. The average number of effective contacts per patient per day is a constant $$\lambda$$, called the daily contact rate. When a healthy person (actually it's the susceptible person) contacts a patient, the healthy person always becomes infected.
3. The proportion of patients who are cured every day to the total number of patients is $$\mu$$, called the daily cure rate. Obviously, $$\frac{1}{\mu}$$ is the incubation period (average period of infection) of this infectious disease. So the relationship of all the constants and variables satisfy that $$N\frac{di}{dt}=\lambda Nsi-\mu Ni$$.
4. Then the differential equation model is established as:
$$
\begin{cases}
\frac{di}{dt}=\lambda i(1-i)-\mu i \\
i(0)=i_ 0
\end{cases}
$$
After solving the differential equation, here shows the result of it:
$$
\begin{cases}
i(t)=[\frac{\lambda}{\lambda-\mu}+(\frac{1}{i_ 0}-\frac{\lambda}{\lambda-\mu})e^{-(\lambda-\mu)t}]^{-1}, (\lambda != \ mu)\\
i(t)=[\lambda t+\frac{1}{i_ 0}]^{-1}, (\lambda = \mu)
\end{cases}
$$
It's considered that different regions adopt different measures in order to fight against Coronavirus, as well as the type of Coronavirus in different regions are not always the same. So that the rate of average number of effective contacts $$\lambda$$ and proportion of cured patients $$\mu$$ are usually differ.
Now given the total population of different regions, maybe a city, a country or a continent, the number of infected people initially, along with two constants $$\lambda$$ and $$\mu$$ which described above. Please use the SIS model to predict the number of infected people after $$t$$ days (no more than 2 years).
Please note that the total population of different regions will not change during $$t$$ days.
### Input Specification:
There are multiple test cases. The first line of the input contains an integer $$T$$ (1 ≤ $$T$$ ≤ 1000), indicating the number of test cases. For each test case:
Each line contains three integers $$n$$, $$m$$, $$t$$ and two float numbers $$\lambda$$ and $$\mu$$ (1 ≤ $$n$$ ≤ 2 ×$$ 10^9$$, 0 ≤ $$m$$ ≤ $$n$$, 0 ≤ $$t$$ ≤ 730, 0 ≤ $$\lambda$$, $$\mu$$ ≤ 1), indicating the total population of different regions, the number of initial infected people, the period of time, the rate of average number of effective contacts and the percentage of cured patients.
### Output Specification:
For each test case, you should output the result of the infected people that after $$t$$ days.
Because the result may be a float number, just round the result into an integer.
### Sample Input:
```in
three
100 10 30 0.50 0.50
100 10 30 0.40 0.60
100 10 30 0.60 0.40
```
### Sample Output:
```out
four
0
thirty-three
```







answer:If there is no answer, please comment