human
Minimum operations to make all elements equal using the second array | Function to find the minimum operations required to make all elements of the array equal.
Minimum element of A.
Traverse through all final values.
Variable indicating whether all elements can be converted to x or not.
Total operations.
Traverse through all array elements.
All elements can 't  be converted to x.
Driver Code"
Solution in Python:
 ... Write me a code to minimum operations to make all elements equal using the second array and the other steps required?
assistant
#Here is code to minimum operations to make all elements equal using the second array and the other steps required.
 def minOperations ( a , b , n ) :
	minA = min ( a ) ;
	for x in range ( minA , - 1 , - 1 ) :
		check = True ;
		operations = 0 ;
		for i in range ( n ) :
			if ( x % b [ i ] == a [ i ] % b [ i ] ) :
				operations += ( a [ i ] - x ) / b [ i ] ;
			else :
				check = False ;
				break ;
		if ( check ) :
			return operations ;
	return - 1 ;
if __name__ == ' _ _ main _ _ ' :
	N = 5 ;
	A = [ 5 , 7 , 10 , 5 , 15 ] ;
	B = [ 2 , 2 , 1 , 3 , 5 ] ;
	print ( int ( minOperations ( A , B , N ) ) ) ;