← All problemsSign in

Game On Rectangle

CodeChefRating 2658Open on judge ↗

There is rectangle of size $N\times M$ with opposite corners at $(0, 0)$ and $(N, M)$; and a *special* point $(x + 0.5, y + 0.5) \ (0 \le x \lt N , 0 \le y \lt M)$. Two players play a game on the rectangle where each player takes alternate turns. In his/her turn, the player will choose a line, either $x=k$ or $y=k$, such that: - $k$ is an integer; - The chosen line divides the current rectangle i

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start