← March 2025 questions

MARCH 2025 / INTERMEDIATE / LEVEL 2 · QUESTION 7

Level 2 · Question 7

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.

A GIC researcher has bred a new species called the alomomofa, which multiplies at an
incredibly fast rate. Each alomomofa can breed 3 more alomomofa every minute. The GIC
researcher is working on a solution to stop them from multiplying, but she needs to know the
total number of alomomofa after n minutes to determine how much of the solution to use to
reduce the population back to 1. The alomomofa multiply in the following way:
●    Initially, with 1 alomomofa, it breeds 3 more every minute
●    When there are 20 alomomofa, they will merge into one alomomoja
Given that alomomoja are unable to reproduce, help the GIC scientist find out how many
alomomofa will be present after n minutes if the initial number of alomomofa is 1.
Input Format
A single integer n, representing the number of minutes.
Output Format
The first line should contain the total number of alomomofa after n minutes.
The second line should contain the total number of alomomoja after n minutes.
Sample Input                                               Sample Output
3                                                          4
3
Explanation
After 1 minute, there will be 1 + 3 = 4 alomomofa.
After 2 minutes, the total number of alomomofa will be 4 + 3 + 3 + 3 + 3 = 16.
After 3 minutes, there will be 16 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 =
64 alomomofa. Every 20 alomomofa will merge to form 1 alomomoja, so there will be 4
alomomofa and  3 alomomoja remaining.
Find the output for the following input:
10000000

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

16
14999997

After minute 2, live counts alternate 4 and 16. Every odd minute from minute 3 creates three non-reproducing alomomoja.

Reveal supplied answer

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

Expected output

16
14999997

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