Product of Prime Factors
Submissions: 2047   Accuracy:

30.33%

  Difficulty: Easy   Marks: 2

Given a number N find the product of all unique prime factors of that number.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains the number N for which the result is to be calculated. 

Output:
Print the product of the unique prime factors for each number in a new line.‚Äč

Constraints:
1<= T <=100
1<= N <=100000

Example:
Input
2
10
25

Output:
10
5

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Sujnesh Mishra
Author: sujnesh


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.