Slot Machines
시간 제한: 1000ms메모리 제한: 128MB출처: CCC 2000 SeniorBOJ 6943
문제
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.
입력
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.
출력
Your program should output the number of times Martha plays until she goes broke.
예제
예제 1
입력
48 3 10 4
출력
Martha plays 66 times before going broke.
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.