Question: CCC ' 0 0 S 1 - Slot Machines View as PDF Submit solution My submissions All submissions Best submissions Voting statistics Points: 5 Time
CCC S Slot Machines
View as PDF
Submit solution
My submissions
All submissions
Best submissions
Voting statistics
Points:
Time limit: s
Memory limit: M
Problem type
Canadian Computing Competition: Stage Junior # Senior #
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
t
h
time it is played; the second machine pays
quarters every
t
h
time it is played; the third pays
quarters every
t
h
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
Copy
Sample Output
Copy
Martha plays times before going broke.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
