Nim and Prime factors

3.8

22 votes
Easy-Medium
Problem

Given a number you are required to find the Largest prime divisor and the number of Distinct prime factors it has.

Input :

The first line of the input consists of a single integer t (the number of test cases) ( 1t1000000 )

The next t lines consists of a single integer p representing the query ( 2p10000000 )

Output :

Output contains two space separated integers representing the Largest prime divisor and number of Distinct prime factors .

Sample Input
2
10
30
Sample Output
5 2
5 3
Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?