human
Number of ways to obtain each numbers in range [ 1 , b + c ] by adding any two numbers in range [ a , b ] and [ b , c ] | Python3 program to calculate the number of ways.
Initialising the array with zeros . You can do using memset too ..
Printing the array.
Driver code"
Solution in Python:
assistant
#Here is code to number of ways to obtain each numbers in range [ 1 , b + c ] by adding any two numbers in range [ a , b ] and [ b , c ] and the other steps required.
 def CountWays ( a , b , c ) :
	x = b + c + 1 ;
	arr = [ 0 ] * x ;
	for i in range ( a , b + 1 ) :
		for j in range ( b , c + 1 ) :
			arr [ i + j ] += 1 ;
	for i in range ( 1 , x ) :
		print ( arr [ i ] , end = " ▁ " ) ;
if __name__ == ' _ _ main _ _ ' :
	a = 1 ;
	b = 2 ;
	c = 2 ;
	CountWays ( a , b , c ) ;