407107: GYM102697 078 Flatten The Curve

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

078. Flatten The Curvetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

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.

Input

The 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.

Output

Let $$${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.

ExampleInput
4
.394
.212
.107
.059
Output
67
118
226
403
Note

($$$N$$$ will also have an initial value of 1)

加入题单

上一题 下一题 算法标签: