Wrapper Exchange

A shop runs a promotion where you can buy chocolates with money, then exchange wrappers for more chocolates. The function chocolate_feast receives the budget n, the price of one chocolate c, and the number of wrappers m needed for one exchange. Wrappers from free chocolates also count toward future exchanges. Return the total number of chocolates eaten.

Примеры

Ввод
10, 2, 5
Вывод
6
Ввод
12, 4, 4
Вывод
3
Ввод
6, 2, 2
Вывод
5

Нужно реализовать

def chocolate_feast(n: int, c: int, m: int) -> int:

Теги

math
PostgreSQLv16

Här visas resultatet av din kod

Visible tests
1
Input
10, 2, 5
Expected6
2
Input
12, 4, 4
Expected3
3
Input
6, 2, 2
Expected5
4
Input
100, 1, 100
Expected101
5
Input
15, 3, 2
Expected9
6
Input
-1, 4, 4
Expected-1
Focus radio
Paused · SomaFM · Fluid