The maximum value
57% Success1002 Attempts20 Points1s Time Limit256MB Memory1024 KB Max Code

You are given an integer $$N$$. For each integer $$i$$ from 2 to $$N$$, assign a positive integer A[i] such that the following conditions hold:

  • For any pair of integers $$(i, j)$$, if $$i$$ and $$j$$ are co-prime, then $$A[i] != A[j]$$.
  • The maximum value among all $$A[i]$$ is the minimum possible.

Find the maximum value among all $$A[i]$$'s.

Note: A pair of integers $$(i, j)$$ is said to be co-prime when the greatest common divisor between them is 1.

Input format

  • The first line contains an integer $$T$$ denoting the number of test cases.
  • The first line for each test case contains $$N$$ denoting an integer.

Output format

For each test case, print the maximum value among all $$A[i]$$'s in a new line.

Constraints

\(1 \le T \le 10\)
\(2 \le N \le 10^5\)

Examples
Input
2
4
3
Output
2
2
Explanation

For first test case:

  • One of the possible assignments is A[2] = 1, A[3] = 2, A[4] = 1.
  • Maximum value is 2.

For second test case:

  • One of the possible assignments is A[2] = 2, A[3] = 1.
  • Maximum value is 2.

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 Editor...
Results