Currency Exchange
Chef currently has $A_1$ gold coins and $B_1$ silver coins with him. He can perform the following three types of transformations: - Pay $1$ gold coin and receive $5$ silver coins. This can only be done if he has at least one gold coin. - Pay $5$ silver coins and receive $1$ gold coin. This can only be done if he has at least five silver coins. - Discard one gold coin and one silver coin. Th
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