← November 2025 questions

NOVEMBER 2025 / INTERMEDIATE / QUESTION 7

Signal Median Finder

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 defense system analyses signals in blocks of size n. For each block, it finds the
median, then outputs the most frequent median across all blocks.
Sample Input:
10 2
3 4 4 4 5 5 1 1 1 1
Sample Output:
1
Question Input:
20 4
3 5 2 8 6 9 9 9 1 4 4 4 5 5 5 5 7 8 8 8

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 question input above. Enter only the output.

Reveal worked answer

Your output

4.0

Block medians are 4, 9, 4, 5 and 8. The most frequent is 4.

Source: Girls in Code SEA 2025 Fall Competition, 29 November 2025. Booklet created by Emily Xu and the GIC question authors. Shared for non-commercial educational use with attribution, as permitted in the booklet.