Casino X98527


Statement
 

pdf   zip

html

In order to play table games at the casino you need some tokens. Red tokens cost 7 euros and yellow tokens cost 4. Write a function buy_tokens(n) that given a number n of euros such that n ≥ 20, it returns the equivalence in tokens. When several equivalences are possible the function returns the one minimizing the total number of tokens.

Sample session
>>> buy_tokens(20)
(0, 5)
>>> buy_tokens(50)
(6, 2)
>>> buy_tokens(39)
(5, 1)
Information
Author
Jorge Castro
Language
English
Official solutions
Python
User solutions
Python