## CCC '00 S1 - Slot Machines

View as PDF

Points: 5
Time limit: 1.0s
Memory limit: 256M

Problem type
##### 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.

• commented on May 5, 2024, 7:10 p.m.

Then she plays a scam game in an aracade

• commented on Feb. 19, 2024, 2:59 p.m.

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

• commented on Jan. 31, 2024, 12:43 a.m.

Well, it could be some people's life savings... Not all of us, but at least 700 million people is in absolute poverty...

• commented on May 2, 2024, 4:26 a.m.

And the rest in the Misère de la philosophie

• commented on Feb. 6, 2024, 11:23 p.m.

real

• commented on May 20, 2023, 2:22 p.m.

This comment is hidden due to too much negative feedback. Show it anyway.

• commented on May 30, 2023, 2:22 a.m.

This is the case for nearly all problems on the judge, unless stated otherwise.

• commented on May 1, 2023, 11:19 a.m. edited

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 😛

• commented on March 10, 2022, 10:34 p.m.

all of Martha's life savings are in quarters and now she spent them all...

• commented on June 22, 2022, 12:18 a.m.

This comment is hidden due to too much negative feedback. Show it anyway.

• commented on Nov. 28, 2022, 11:50 p.m.

🤓

• commented on Dec. 10, 2021, 2:45 a.m.

What if she wins and earns more money?

• commented on March 6, 2022, 3:45 p.m.

Rule of las Vegas. The house always wins (unless you know when to quit)

• commented on Dec. 10, 2021, 1:39 p.m.

Then she uses the earned money on the machines.