Casino X98527


Statement
 

pdf   zip

In order to play table games at the casino you need some tokens. Red tokens cost 77 euros and yellow tokens cost 44. Write a function @buy_tokens(n)@ that given a number nn of euros such that n20n \ge 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

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