human
Minimum steps to change N to 1 by changing it to 2 * N or N / 10 at any step | Function to check if N can be changed to 1 or not ..
Count the number of 2 in the prime factorisation of N.
Count the number of 5 in the prime factorisation of N.
Driver Code"
Solution in Python:
assistant
#Here is code to minimum steps to change N to 1 by changing it to 2 * N or N / 10 at any step and the other steps required.
 def check ( N ) :
	twos = 0
	fives = 0
	while ( N % 2 == 0 ) :
		N /= 2
		twos += 1
	while ( N % 5 == 0 ) :
		N /= 5
		fives += 1
	if ( N == 1 and twos <= fives ) :
		print ( 2 * fives - twos )
	else :
		print ( - 1 )
if __name__ == ' _ _ main _ _ ' :
	N = 50
	check ( N )