| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 128 MB | 167 | 61 | 55 | 41.985% |
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 30ドル$ quarters every 35ドル^{th}$ time it is played; the second machine pays 60ドル$ quarters every 100ドル^{th}$ time it is played; the third pays 9ドル$ quarters every 10ドル^{th}$ time it is played.
Your program should take as input the number of quarters in Martha's jar (there will be at least one and fewer than 1000ドル$), and the number of times each machine has been played since it last paid.
Your program should output the number of times Martha plays until she goes broke.
48 3 10 4
Martha plays 66 times before going broke.