Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Plot
- In a forest, there were 'x' bunnies, 50% male, and 50% female, all adults. Bunnies doubles every 15 days, 10% of the baby rabbits dies at birth. They mature after 30 days, 30% leave the forest, and rest becomes rabbits. In every 30 days , 25% dies off due to flu. If every bunny dies off, the bunny world ends.
- Task
- Calculate the final number of bunnies alive after 1 year for any number of initial bunnies, x.
- Input
- Will be an integer number, the number of initial bunnies. Your program should read from the standard input
- Output
- Your program should write back to the standard output. When all bunnies die off, write 0 to the standard output.
- Please note that percentages are truncated
- Example
- Test Case 1
- 444 (input)
- 0 (output)
- Test Case 2
- 30000 (input)
- 56854 (output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement