human
Minimize cost to make X and Y equal by given increments | Function to find gcd of x and y.
Function to find lcm of x and y.
Function to find minimum Cost.
Subtracted initial cost of x.
Subtracted initial cost of y.
Driver Code.
Returns the minimum cost required"
Solution in Python:
assistant
#Here is code to minimize cost to make X and Y equal by given increments and the other steps required.
 def gcd ( x , y ) :
	if ( y == 0 ) :
		return x
	return gcd ( y , x % y )
def lcm ( x , y ) :
	return ( x * y ) // gcd ( x , y )
def minimumCost ( x , y ) :
	lcm_ = lcm ( x , y )
	costx = ( lcm_ - x ) // x
	costy = ( lcm_ - y ) // y
	return costx + costy
if __name__ == " _ _ main _ _ " :
	x = 5
	y = 17
	print ( minimumCost ( x , y ) )