407107: GYM102697 078 Flatten The Curve
Description
Throughout this global pandemic, many health experts and doctors are steadfast on the effort to "flatten the curve", or to decrease the maximum amount of people who are getting infected by the virus, using the method of social distancing, one of the reasons why we are in quarantine at this very moment.
The daily rate of infection, if left unchecked, can look a lot like this logistic function, where $$$\Delta N$$$ is the total number of cases, $$$\Delta t$$$ is the time period for new infections, (which, in this case, would be one day.)
$$$\frac{\Delta N}{\Delta t} = a(1-\frac{N}{N_{max}})N$$$
$$$a$$$ is the infection rate, which, for COVID-19, would be .394 (with social distancing, the number is able to go down). Finally, $$$N_{max}$$$ is the total amount of infections we can expect for the curve to flatten. In this simulation, we will calculate the total number of days $$$t$$$ the virus will take in order for it to infect the entire population of America dependant on its infection rate, which will be about 320 million people.
InputThe first line will contain the integer $$$n$$$, which denotes the amount of test cases that will follow. Each line below the first line will contain a floating point value $$$a$$$, which is the infection rate for that test case.
OutputLet $$${N_{max}}$$$ be equal to around 328.2 million people, which is the entire population of the US, however, you should output the number of days it takes for the virus to infect 320 million people, which is a vast majority.
ExampleInput4 .394 .212 .107 .059Output
67 118 226 403Note
($$$N$$$ will also have an initial value of 1)