Text from the official booklet. Refer to the PDF for original mathematical notation, formatting, and linked input files. Printed samples and inputs are reproduced as published.
You are tasked with simulating the growth of a population of bacteria in a controlled environment. Your goal is to create a program that models the increase in the bacterial population over a specified number of days. The bacteria multiply based on a given growth rate, and the simulation should track the total population size each day. You are given 3 numbers: • The first integer, b, is the initial number of bacteria. • The second integer, m, is the maximum carrying capacity of the environment. • The float, r, is the growth rate—a float between 0 and 1, representing the fraction of the current bacterial population that multiplies each day. You should return an answer that is the days until the population reaches or exceeds the carrying capacity. Sample Input and Output Input: b = 10 m = 1000 r = 0.2 Output: 26 Explanation: Day 1: 10 → 10 + (10 * 0.2) = 12 Day 2: 12 → 12 + (12 * 0.2) = 14.4 … Day 26: Population reaches or exceeds 1000 Output the number of days for the following input: Input: b = 1000.076893438 m = 7897654345678965345678907654323456789876534567432345698767890987.987678 r = 0.3758938726