← March 2025 questions

MARCH 2025 / ADVANCED / QUESTION 8

Question 8

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 given seven (not necessarily distinct) integers in the range 1…109, which represent the
values of A, B, C, A+B, B+C, C+A, and A+B+C in some order. It is guaranteed that A, B, and C
are positive integers and that A ≤ B ≤ C.
Determine and output the values of A, B, and C in ascending order.
INPUT FORMAT:
The only line of input consists of seven space-separated integers.
OUTPUT FORMAT:
Print A, B, and C separated by spaces.
SAMPLE INPUT:
2 2 11 4 9 7 9
SAMPLE OUTPUT:
2 2 7
Input
Case 1:
75355967 870798864 541745076 946154831 466389109 404409755
479765722
Case 2:
326552445 762589144 699462434 63126710 436036699 372909989
389679155

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.

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

75355967 404409755 466389109

Case 2

63126710 326552445 372909989

The two smallest values are A and B; subtract them from the largest (A+B+C) to find C.

Reveal supplied answers

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

Case 1

75355967 404409755 466389109

Case 2

63126710 326552445 372909989

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