We have input data M and N , N>M , M >0 After that we create a list from 1 to M , and then we need to find all possible options for the sums of the elements in the list so that the sum of the elements equals N , and each element of the list can be added by itself with a few times. Print the amount of sums that can be made in the list.
For example: M = 3 , N = 4 , ---> [1,2,3] ---> 1+1+1+1 , 1+1+2 , 1+2+1 , 2+1+1 , 2+2 , 1+3 , 3+1 , the number of possible variants of the sums in this example = 7
C = lambda m, n: sum(C(m-1, nk*m) for k in range(n//m+1)) if m > 1 and n > 1 else 1- jfs