Prime Factors
Submissions: 4669   Accuracy:

22.22%

  Difficulty: Easy   Marks: 2

Given a number N. The task is to print all its unique prime factors in increasing order.

Input:
The first line of input contains an integer T denoting the number of test cases. T testcases follow.
The first line of each test case is N.

Output:
For each testcase, in a new line, print all prime factors in increasing order separated by space.

Constraints:
1 ≤ T ≤ 10000
2 ≤ N ≤ 106

Example:
Input:
2
100
35

Output:
2 5
5 7

Explanation:
Testcase1:
2 and 5 are the only prime factors of 100.
 

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

Author: kartik


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.