AMR10C - Square Free Factorization

no tags 

You all know about factorization of an integer. Here we want you to factor a number into as few factors as possible. That is easy, you say, just have the number itself, and that will be the smallest number of factors i.e. 1.

But wait, I haven't finished — each of the factors that you find must be square-free. A square-free number, however you factor it, won't have any factor that is a perfect square.  Of course, you can never include 1 as a factor.

Input

The first line of input is the number of test cases T. The next T lines each have an integer N.

Output

For each test case, output the smallest number of square-free factors.

Constraints

T ≤ 104
2 ≤ N ≤ 106

Example

Input:
2
6
8

Output:
1
3

hide comments
Madhav: 2015-03-29 14:08:14

good concept!!

Malinga: 2015-01-09 09:32:09

Sieve+fast I/O...AC in 1.19 sec

Anubhav Balodhi : 2014-12-30 09:35:03

Mathematical one ^_^

BLANKRK: 2014-06-25 22:40:56

nice !!! :)

abhishek nagpal: 2013-09-01 12:03:17

what will be the answer for 44?
2 or 3?

Spar!k: 2013-02-05 00:13:02

sieve just makes it slower. sqrt(n) is ok

Branfili: 2012-12-15 22:04:39

@Kennard
2, because 36=6*6

maverick: 2012-02-09 07:58:24

I am continuously getting
Error

Wrong problem code!

Please fix this error! I think the problem is temporarily removed from the main problemset.

Kennard: 2010-12-27 18:20:16

36? is the answer is 2 or 4?


Added by:Varun Jalan
Date:2010-12-13
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:own problem, ICPC Asia regionals, Amritapuri 2010