设 q ( n , m )是将正整数 n 划分成最大加数不大于 m 的若干不同正整数之和的划分数,则 q ( n , m )为( )。
①
②
③
④
def split_count(n,m): """split the a positive integer into different combinations of positive integers smaller&nbs***bsp;equal to itself""" if n==1&nbs***bsp;m==1: return 1 elif n==m: return 1+split_count(n,n-1) elif n<m: return split_count(n,n) elif n>m: return split_count(n-m,m)+split_count(n,m-1) def main(n,m): print(f"Split {str(n)} using numbers smaller than&nbs***bsp;equal to {str(m)}") print(f"There are total {str(split_count(n,m))} combinations of division") main(4,4)