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
Clarification. If you're not getting AC but the sample input gives you the same output as the sample output:
you have to word the out put EXACTLY like it says in the sample output. Include the sentence( string). Not just the results.
I think this was a bad explanation because it doesn't directly explain that, which could lead a lot of people trying to change their code when it's fundamentally correct.
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.