• + 0 comments

    Here is my Python solution!

    def chocolateFeast(n, c, m):
        wrap = n // c
        total = n // c
        while True:
            if wrap < m:
                return total
            total += wrap // m
            wrap = wrap // m + wrap % m