题解 | #放苹果#
放苹果
https://www.nowcoder.com/practice/bfd8234bb5e84be0b493656e390bdebf
def count(m, n):
if m == 0 or n == 1:
return 1
elif n > m:
return count(m, m)
else:
return count(m, n - 1) + count(m - n, n)
while True:
try:
lis = list(map(int,input().split()))
app = lis[0]
ple = lis[1]
print(count(app, ple))
except:
break