← March 2025 questions

MARCH 2025 / INTERMEDIATE / LEVEL 2 · QUESTION 3

Level 2 · Question 3

Archived question

Try the question in your own editor, then check your output below.

THE QUESTION

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

CHECK YOUR ANSWER

Try your answer.

Run your program in your own editor, then paste its output below. This checks the stated output; it does not assess your full program. Practice attempts do not affect competition scores.

Use the corresponding input from the question. For lists, brackets and commas are optional for numeric answers; text lists may also be entered one item per line.

Reveal worked answer

Your output

440

Multiply the population by 1+r each day until it reaches the carrying capacity. High-precision decimal arithmetic gives the first qualifying day.

Reveal supplied answer

From the supplied Intermediate answer key. Outputs are reproduced as provided.

Expected output

440

Source: GIC 2025 Intermediate Questions and the supplied Intermediate answer key, March 2025 archive.