Hello there friends! This the CodeChef series again.
In CodeChef, the second, according to number of successful submissions on the beginner practice page, is the ATM problem. This simple question is related to bank transactions where one may withdraw money from an ATM. It was an interesting problem for me for it helps relate programming to real life considering everyone has been to or at least seen an ATM. This question may help a learner understand the logic behind one too though the real thing is far more complicated than the program I wrote below as an answer: