• + 0 comments
    def howManyGames(p, d, m, s):
        # Return the number of games you can buy
        cost = p
        count = 0 
        while cost <=s:
            if p-d > m:
                p = p - d
                cost += p
                count += 1   
            else:
                cost += m
                count += 1 
        return count