human
Write me a code to maximum positive integer divisible by C and is in the range [ A , B ] and the other steps required given the following:
Maximum positive integer divisible by C and is in the range [ A , B ] | Function to return the required number.
If b % c = 0 then b is the required number.
Else get the maximum multiple of c smaller than b.
Driver code"
Solution in Python:
assistant
#Here is code to maximum positive integer divisible by C and is in the range [ A , B ] and the other steps required.
 def getMaxNum ( a , b , c ) :
	if ( b % c == 0 ) :
		return b
	x = ( ( b // c ) * c )
	if ( x >= a and x <= b ) :
		return x
	else :
		return - 1
a , b , c = 2 , 10 , 3
print ( getMaxNum ( a , b , c ) )