← All problemsSign in

Abhi And Ambi play a game

Two friends Abhi and Ambi are playing a game. The game is played over N piles of coins with each pile having A coins. It is given that A is Prime. The game is played according to some rules. 1. Each player in his turn can choose a pile of coins and remove some X>0 number of coins from the chosen pile. 2. The number X chosen should be such that X number of coins were not removed in any of the pre

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