A patient with first stage zombie virus has escaped from the facility in a city of population N. The zombie virus is very dangerous as it passes on to othr people as they come in contact with the patient makin them a petient as well. Zombie virus has K life stages to develop, each of which takes 1 unit of time. Only the last stage is contagious. A person with zombie attack only healthy people and can oly affect one person in 1 unit of time. If the patient escaped on day 1, find out the number of days it will take to wipe out the entire city's healthy population and turn them into a last stage zombie. Note: 1 unit of time is equal to 1 day.
i/p1: Total healthy population of the city
i/p2: No. of stages of zombie virus.
Ex1
i/p1:10
i/p2:1
o/p:5
Hence, on day2, the affected population will be 2 and so on. On day 5, the affected population will be 16 which is bigger than 10. Ex2
i/p1:10
i/p2:2
o/p:6 It takes 2 days for virus to evolve.
Comments
Leave a comment