The Shakuni Game
CodeChefOpen on judge ↗
Shakuni, fond of playing manipulative games is playing one with Yudhishthir. Shakuni has given Yudhishthir $N$ stones and asked him to repeat the following operation until $NN$ becomes $11$: - Choose an integer $XX$ such that $X \geq 1$ and $X$ is a divisor of $N$, and then divides $N$ by $X$ (the new value of $N$ becomes $N/X$). If $X$ is even, Yudhishthir gets $A$ points, otherwise he gets $B$
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.
Sign in to chat with the tutor and save your progress.
Sign in to start