If there is no prime factor of a given integer, then print -1.
The first line of input contains an integer ‘T’ denoting the number of test cases.
The first and only line of each test case contains a positive integer ‘n’.
For each test case, print the largest prime factor of the given positive integer in a separate line.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 50
1 <= n <= 10^9
Where ‘T’ is the number of test cases and ‘n’ is the size of the array.
Time Limit: 1 sec
In the upside-down division or repeated division method of finding prime factorization, we repeatedly divide the number with its smallest factor to find its prime factorization. We can use this method as follows to find the largest prime factor of the given integer.
Ninja And The LCM
A Number Game
Pair Product Div by K
Pair Product Div by K
Merge Two Sorted Arrays Without Extra Space
Co-Prime