← March 2025 questions

MARCH 2025 / ADVANCED / QUESTION 7

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 coding competition platform is hosting an online contest where participants answer
challenging problems to demonstrate their skills.
To accommodate a wide range of participants, the competition has four difficulty divisions:
bronze, silver, gold, and platinum. All new participants start in the bronze division, and whenever
a participant achieves a perfect score in a contest, they are promoted to the next division. It is
even possible for a participant to be promoted multiple times within the same contest.
The platform maintains a list of all participants and their current divisions, ensuring they start at
the correct level in future contests.
After the latest contest, the organizers want to publish statistics on how many participants were
promoted from bronze to silver, silver to gold, and gold to platinum. However, they forgot to track
promotions in real time. Fortunately, they realize that they can deduce the number of promotions
based on the number of participants in each division before and after the contest.
Your task is to calculate the number of promotions that occurred at each level.
INPUT FORMAT:
Input consists of four lines, each containing two integers in the range 0..1,000,000. The first line
specifies the number of bronze participants registered before and after the contest. The second
line specifies the number of silver participants before and after the contest. The third line
specifies the number of gold participants before and after the contest. The last line specifies the
number of platinum participants before and after the contest.
OUTPUT FORMAT:
Please output three lines, each containing a single integer. The first line should contain the
number of participants who were promoted from bronze to silver. The second line should
contain the number of participants who were promoted from silver to gold. The last line should
contain the number of participants who were promoted from gold to platinum.
SAMPLE INPUT:
1 2
1 1
1 1
1 2
SAMPLE OUTPUT:
1
1
1
In this example, 1 participant was registered in each division prior to the contest. At the end of
the contest, 2 participants were registered in bronze and platinum. One way this could have
happened is that 2 new participants joined during the contest; one was promoted all the way to
platinum, and the other stayed in bronze.
Input
Case 1:
61313 95144
25857 1516
16124 45241
53895 75624
Case 2:
49676 130031
93368 5835
47739 52611
10012 105072

CHECK YOUR ANSWER

Try your answer.

The supplied answer sheet disagrees with the worked result. This checker uses the recalculated answer; the original sheet is retained below for reference.

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.

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

Case 1

26505
50846
21729

Case 2

12399
99932
95060

Gold→platinum is the platinum increase. Add the gold increase for silver→gold, then the silver increase for bronze→silver.

Reveal supplied answers

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

Case 1

261005
100846
21729

Case 2

12399
99932
910060

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