Prime Factor
Practice
3.5 (4 votes)
Easy
Problem
56% Success 1566 Attempts 20 Points 5s Time Limit 256MB Memory 1024 KB Max Code

The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of a given number N?

Input Format

First line contains T, the number of test cases. This is followed by T lines each containing an integer N .

Constraints 1 ≤ T ≤ 100 10 ≤ N ≤ 10^12

Output Format

For each test case, display the largest prime factor of N .

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
4 votes
Tags:
MathematicsOpenApprovedEasyMathamatics
Points:20
2 votes
Tags:
ImplementationEasySimple-math
Points:20
2 votes
Tags:
Basic ProgrammingBit manipulationBasics of Bit ManipulationEasymathsBit Manipulation