{"raw_statement":[{"iden":"problem statement","content":"Given an integer $N$ not less than $2$, find the number of integers $b$ not less than $2$ such that:\n\n*   when $N$ is written in base $b$, every digit is $0$ or $1$.\n\nFind the answer for $T$ independent test cases.\nIt can be proved that there is a finite number of desired integers $b$ not less than $2$ under the constraints of this problem."},{"iden":"constraints","content":"*   $1 \\leq T \\leq 1000$\n*   $2 \\leq N \\leq 10^{18}$\n*   All values in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format, where $\\mathrm{test}_i$ denotes the $i$\\-th test case:\n\n$T$\n$\\mathrm{test}_1$\n$\\mathrm{test}_2$\n$\\vdots$\n$\\mathrm{test}_T$\n\nEach test case is given in the following format:\n\n$N$"},{"iden":"sample input 1","content":"3\n12\n2\n36"},{"iden":"sample output 1","content":"4\n1\n5\n\nFor the first test case, four $b$'s satisfy the condition in the problem statement: $b = 2, 3, 11, 12$. Indeed, when $N=12$ is written in base $2, 3, 11$, and $12$, it becomes $1100, 110, 11$ and $10$, respectively."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}