CF1855B.Longest Divisors Interval

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

Longest Divisors Interval

Given a positive integer nn, find the maximum size of an interval [l,r][l, r] of positive integers such that, for every ii in the interval (i.e., lirl \leq i \leq r), nn is a multiple of ii.

Given two integers lrl\le r, the size of the interval [l,r][l, r] is rl+1r-l+1 (i.e., it coincides with the number of integers belonging to the interval).

Input

The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases.

The only line of the description of each test case contains one integer nn (1n10181 \leq n \leq 10^{18}).

Output

For each test case, print a single integer: the maximum size of a valid interval.

Note

In the first test case, a valid interval with maximum size is [1,1][1, 1] (it's valid because n=1n = 1 is a multiple of 11) and its size is 11.

In the second test case, a valid interval with maximum size is [4,5][4, 5] (it's valid because n=40n = 40 is a multiple of 44 and 55) and its size is 22.

In the third test case, a valid interval with maximum size is [9,11][9, 11].

In the fourth test case, a valid interval with maximum size is [8,13][8, 13].

In the seventh test case, a valid interval with maximum size is [327869,327871][327869, 327871].

Samples

10
1
40
990990
4204474560
169958913706572972
365988220345828080
387701719537826430
620196883578129853
864802341280805662
1000000000000000000
1
2
3
6
4
22
3
1
2
2

在线编程 IDE

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