Crazy Number
CodeChefOpen on judge ↗
Sayantan and his girlfriend are both crazy. They decide to play a game of numbers. Sayantan chooses a number $N$ and he gives his girlfriend a number $M$. The game proceeds as follows:- 1. Sayantan's girlfriend chooses an arbitrary number $d$. 2. Sayantan performs exactly one of the following actions: - add d to $N$, add d−1 to $M$ - add d−1 to $N$, add d to $M$ The game ends when $N$=$
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