题解 | #放苹果#
放苹果
https://www.nowcoder.com/practice/bfd8234bb5e84be0b493656e390bdebf
import sys def put(left_num:int, last_plate_load:int, left_plate_num:int): result = 0 if left_plate_num == 1 and left_num >= last_plate_load: return 1 for possible_load in range(last_plate_load, left_num // left_plate_num + 1): result += put(left_num - possible_load, possible_load, left_plate_num - 1) return result m, n = [int(i) for i in input().split()] print(put(m, 0, n))