Canadian Computing Competition: 2000 Stage 1, Junior #3, Senior #1
Martha takes a jar of quarters to the casino with the intention of becoming rich. She plays three machines in turn. Unknown to her, the machines are entirely predictable. Each play costs one quarter. The first machine pays quarters every time it is played; the second machine pays quarters every time it is played; the third pays quarters every time it is played.
Input Specification
Your program should take as input the number of quarters in Martha's jar (there will be at least one and fewer than ), and the number of times each machine has been played since it last paid.
Output Specification
Your program should output the number of times Martha plays until she goes broke.
Sample Input
48
3
10
4
Sample Output
Martha plays 66 times before going broke.
Comments
i still dont get how the last three lines of input. are they literally just the amount of times the machines were used before Martha arrived since last payout? are they the amount of times she has already used them? i wrote my code assuming the former, and i dont know whats wrong with my logic. dont know if others can view it, but heres mine: https://dmoj.ca/submission/6216648
Well, it could be some people's life savings... Not all of us, but at least 700 million people is in absolute poverty...
And the rest in the Misère de la philosophie
real
This comment is hidden due to too much negative feedback. Show it anyway.
This is the case for nearly all problems on the judge, unless stated otherwise.
Ah, competitive programming of >20 years past. Output in natural language with no indication about irrelevant details like whether you have to conjugate plurality correctly 😛
all of Martha's life savings are in quarters and now she spent them all...
This comment is hidden due to too much negative feedback. Show it anyway.
🤓
What if she wins and earns more money?
Rule of las Vegas. The house always wins (unless you know when to quit)
Then she uses the earned money on the machines.