← November 2025 questions

NOVEMBER 2025 / ADVANCED / QUESTION 9

Question 9

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.

Earth is under attack! Across a two-dimensional battlefield, N hostile robots are stand-
ing at distinct coordinates
(x1, y1), (x2, y2), . . . ,(xN , yN ),
where each xi and yi is a positive odd integer, and 1 ≤ N ≤ 100.
To defend the area, Commander Nova wants to deploy two energy barriers:
• A vertical barrier along the line x = a,
• A horizontal barrier along the line y = b.
Both a and b must be even integers, ensuring the barriers never slice directly through
a robot.
These two barriers intersect at point ( a, b), dividing the battlefield into four sectors.
Commander Nova wants the robots to be as evenly distributed as possible.
For any chosen pair (a, b), define M as the maximum number of robots contained in any
one of the four sectors.
Task
Find the positions ( a, b) that minimize M , achieving the most balanced possible parti-
tioning of the robot forces.
Input Format
• The first line contains two integers N and B.
• The next N lines each contain the coordinates of a robot: an odd integer x and an
odd integer y, both at most B.
Output Format
Output a single integer: the smallest possible value of M , the minimum worst-case
number of robots in any sector.
Sample Input
7 10
7 3
5 5
9 7
3 1
7 7
5 3
9 1
Sample Output
2
Question Input File:
• Input: https://shorturl.at/o9iFE

PRACTICE CHECK

Try your answer.

The linked final-input download could not be retrieved (checked 28 October 2026). This checks the complete published sample, not the unavailable final input.

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

Use the published seven-robot sample. Enter the smallest possible maximum quadrant count.

Reveal worked answer

Your output

2

Try even barriers just past each distinct x and y coordinate. Count all four quadrants and minimise their largest count.

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.