human
Find the largest good number in the divisors of given number N | function to return distinct prime factors.
to store distinct prime factors.
run a loop upto sqrt ( n ).
place this prime factor in vector.
This condition is to handle the case when n is a prime number greater than 1.
function that returns good number.
distinct prime factors.
to store answer.
product of all distinct prime factors is required answer.
Driver code.
function call"
Solution in Python:
assistant
#Here is code to find the largest good number in the divisors of given number N and the other steps required.
 def PrimeFactors ( n ) :
	v = [ ]
	x = n
	i = 2
	while ( i * i <= n ) :
		if ( x % i == 0 ) :
			v . append ( i )
			while ( x % i == 0 ) :
				x //= i
		i += 1
	if ( x > 1 ) :
		v . append ( x )
	return v
def GoodNumber ( n ) :
	v = PrimeFactors ( n )
	ans = 1
	for i in range ( len ( v ) ) :
		ans *= v [ i ]
	return ans
if __name__ == " _ _ main _ _ " :
	n = 12
	print ( GoodNumber ( n ) )