This page is still under construction.

Parts of this page are still being built. What you see may change.

Multiple of a Squared Factorial

Time limit3sMemory limit512 MB

Summary
For many queries N, find the smallest K such that K! is divisible by (N!)^2. The answer is always between N and 2N, and needs Legendre exponent checks.
Level

Hard8 of 10

Topics
Number theory, Math, Binary search, Implementation
Solved
No attempts yet

Problem

Given a positive integer NN, find the smallest positive integer KK such that K!K! is a multiple of (N!)2(N!)^2.

An integer aa is a multiple of bb when a=b×ka = b \times k holds for some integer kk. For a positive integer MM, M!M! is the product of all positive integers that are at most MM.

Input

The first line contains TT, the number of test cases. Each of the next TT lines contains one integer NN.

Constraints

  • 1≤T≤2000001 \le T \le 200000
  • 1≤N≤2000001 \le N \le 200000

Output

For each test case, print the answer on its own line.

Examples1

  1. Example 1

    Input
    5
    4
    5
    7
    11
    24
    
    Expected output
    8
    10
    14
    22
    48