BETA

Difficulty Level: Medium

Submissions: 3359 Accuracy:

18.84%

Largest prime factor
         

Given a no N, the task is to find the largest prime factor of the number.

Input:
The first line of input contains an integer T, denoting the no of test cases. Then T test cases follow. Each test case contains an integer N.

Output:
For each test case in a new line print the largest prime factor of N.

Constraints:
1<=T<=100
2<=N<=10^11+1

Example:
Input:

2
6
15
Output:
3
5

 

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

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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