Codeforces Round 889 (Div. 2)
B
Longest Divisors Interval
Codeforces
900
原题
← AC1 →
翻译中…

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

翻译中…

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

翻译中…

Input

翻译中…

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

翻译中…

The only line of the description of each test case contains one integer $n$ ($1 \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]$ (it's valid because $n = 1$ is a multiple of $1$) and its size is $1$.

翻译中…

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

翻译中…

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

翻译中…

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

翻译中…

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

翻译中…

样例

Input #1
10
1
40
990990
4204474560
169958913706572972
365988220345828080
387701719537826430
620196883578129853
864802341280805662
1000000000000000000
Output #1
1
2
3
6
4
22
3
1
2
2
InputCopy OutputCopy
题目信息
题号
1855B
时间限制
2 s
内存限制
256 MB
标签
暴力
组合数学
贪心
数学
数论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。