human
Print all numbers that can be obtained by adding A or B to N exactly M times | Function to find all possible numbers that can be obtained by adding A or B to N exactly N times.
If number of steps is 0 and only possible number is N.
Add A to N and make a recursive call for M - 1 steps.
Add B to N and make a recursive call for M - 1 steps ..
Driver Code.
Given Inputs.
Stores all possible numbers.
Function call.
Print all possible numbers"
Solution in Python:

Can you provide a code to print all numbers that can be obtained by adding A or B to N exactly M times and the other steps required?
assistant
#Here is code to print all numbers that can be obtained by adding A or B to N exactly M times and the other steps required.
 def possibleNumbers ( numbers , N , M , A , B ) :
	if ( M == 0 ) :
		numbers . add ( N )
		return
	possibleNumbers ( numbers , N + A , M - 1 , A , B )
	possibleNumbers ( numbers , N + B , M - 1 , A , B )
if __name__ == ' _ _ main _ _ ' :
	N = 5
	M = 3
	A = 4
	B = 6
	numbers = set ( )
	possibleNumbers ( numbers , N , M , A , B )
	for x in numbers :
		print ( x , end = " ▁ " )