CCC '00 S1 - Slot Machines

View as PDF

Submit solution

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 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.

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 1000), 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


  • -2
    Jules830  commented on Dec. 19, 2024, 3:43 p.m.

    I think that we should change our currency to corn, it would be much more sustainable, and imagine winning at a slot machine and all the corn just comes out in a pool of golden glory.


  • 0
    AdamChaCha  commented on Oct. 28, 2024, 7:39 p.m. edited

    我真的很喜欢写代码!


    • -3
      eprohappy  commented on Dec. 16, 2024, 2:45 a.m. edit 2

      are you stupid(in a good way)

      sorry if i offended you i didnt mean to


    • 2
      willchiken  commented on Dec. 9, 2024, 8:14 p.m.

      ok lil bro


      • -5
        AdamChaCha  commented on Dec. 9, 2024, 8:16 p.m.

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


        • 2
          CoderGrinder  commented on Dec. 17, 2024, 3:10 a.m.

          u think ur him 💀💀💀🤣🤣


  • 0
    TNTKing246  commented on June 28, 2024, 4:15 p.m.

    I keep getting a fail on this. I'm not sure why.


    • 7
      jrkws  commented on June 28, 2024, 7:01 p.m.

      You need a period on the print statement.