CF1474B.Different Divisors

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

Different Divisors

Positive integer xx is called divisor of positive integer yy, if yy is divisible by xx without remainder. For example, 11 is a divisor of 77 and 33 is not divisor of 88.

We gave you an integer dd and asked you to find the smallest positive integer aa, such that

  • aa has at least 44 divisors;
  • difference between any two divisors of aa is at least dd.

Input

The first line contains a single integer tt (1t30001 \leq t \leq 3000) — the number of test cases.

The first line of each test case contains a single integer dd (1d100001 \leq d \leq 10000).

Output

For each test case print one integer aa — the answer for this test case.

Note

In the first test case, integer 66 have following divisors: [1,2,3,6][1, 2, 3, 6]. There are 44 of them and the difference between any two of them is at least 11. There is no smaller integer with at least 44 divisors.

In the second test case, integer 1515 have following divisors: [1,3,5,15][1, 3, 5, 15]. There are 44 of them and the difference between any two of them is at least 22.

The answer 1212 is INVALID because divisors are [1,2,3,4,6,12][1, 2, 3, 4, 6, 12]. And the difference between, for example, divisors 22 and 33 is less than d=2d=2.

Samples

2
1
2
6
15

在线编程 IDE

建议全屏模式获得最佳体验