TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

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 Format

The first line of input is the number of test cases T.

The next T lines each have an integer N.

T <= 1e4

2 <= N <= 1e6

Output Format

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

Sample Input 1

2
6
8

Sample Output 1

1
3

Hints

6 can be factored as just 6 (further factorable as 2x3 only, and hence square free), a single factor. 8 has to be factored as 2x2x2 so that all factors are square-free.

Problem Source

Migrated from old NTUJ.

Regional Amritapuri 2010

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 200