human
Find smallest number K such that K % p = 0 and q % K = 0 | Function to return the minimum value K such that K % p = 0 and q % k = 0.
If K is possible.
No such K is possible.
Driver code"
Solution in Python:

=====
Write me a code to find smallest number K such that K % p = 0 and q % K = 0 and the other steps required?
assistant
#Here is code to find smallest number K such that K % p = 0 and q % K = 0 and the other steps required.
 def getMinVal ( p , q ) :
	if q % p == 0 :
		return p
	return - 1
p = 24 ; q = 48
print ( getMinVal ( p , q ) )