难度:中等
枚举就行
class Solution:
def waysToBuyPensPencils(self, total: int, cost1: int, cost2: int) -> int:
res = 0
for i in range(total//cost1 + 1):
res += (total - i * cost1) // cost2
res += 1
return res