← All problemsSign in

Bank Glitch

CodeChefRating 649Open on judge ↗

In Chefland, there are $2$ currencies in use, currency $1$ and currency $2$. Normally, one unit of currency $1$ is worth exactly $1$ unit of currency $2$. Chef currently has $A$ units of currency $1$, and $B$ units of currency $2$. However, he has found a glitch in the banking system, which allows him to trade $X$ units of currency $1$ for $Y$ units of currency $2$, where $X < Y$, so this is a

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