Logo
(追記) (追記ここまで)

6943번 - Slot Machines 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB167615541.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.

제한

예제 입력 1

48
3
10
4

예제 출력 1

Martha plays 66 times before going broke.

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2000 > CCC 2000 Junior Division 3번

Olympiad > Canadian Computing Competition & Olympiad > 2000 > CCC 2000 Senior Division 1번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /