← All problemsSign in

Brand New Game

CodeChefRating 2818Open on judge ↗

Consider the following game that is played on the field of the size of 1 x N cells. The cells are numbered from 1 to N. In the i-th cell there are two positive integers written - Ai and Bi. The game is as follows. Initially, the player stands at the fictive cell with the index 0 that is located right before all the N cells of the board. Then, he makes moves. Each move consists in moving by no mo

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