• + 0 comments
    def chocolateFeast(n, c, m):
        total_bars=n//c
        wrappers=total_bars 
        while True:
            bars=wrappers//m 
            total_bars+=bars 
            
            wrappers=(wrappers%m)+bars 
            if wrappers//m==0:
                break
        return total_bars