← All problemsSign in

Infinite Grid Game

CodeChefRating 1512Open on judge ↗

After a long period of relaxation Alice and Bob decided to play a game. This time of course not a number game. The rules of the game are as follows: There is a vehicle situated at the point (m, n) of a rectangular grid. Only one corner of the rectangular grid is defined, i.e. the left-top point (0, 0), which is also known as the origin. The grid extends infinitely towards east and infinitely towa

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