#abc243g. G - Sqrt

G - Sqrt

Score : 600600 points

问题陈述

我们有一个长度为 11 的序列:A=(X)A=(X)。让我们对这个序列执行以下操作 1010010^{100} 次。

操作:令 YYAA 尾部的元素。从 11Y\sqrt{Y}(包含)之间选择一个整数,并将其追加到 AA 的末尾。

经过 1010010^{100} 次操作后,可以得到多少种不同的序列?

你将得到 TT 个测试用例需要解决。

在约束条件下,可以证明答案小于 2632^{63}

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

We have a sequence of length 11: A=(X)A=(X). Let us perform the following operation on this sequence 1010010^{100} times.

Operation: Let YY be the element at the end of AA. Choose an integer between 11 and Y\sqrt{Y} (inclusive), and append it to the end of AA.

How many sequences are there that can result from 1010010^{100} operations?

You will be given TT test cases to solve.

It can be proved that the answer is less than 2632^{63} under the Constraints.

Constraints

  • 1T201 \leq T \leq 20
  • 1X9×10181 \leq X \leq 9\times 10^{18}
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

TT

case1\rm case_1

\vdots

caseT\rm case_T

Each case is in the following format:

XX

Output

Print TT lines. The ii-th line should contain the answer for casei\rm case_i.

Sample Input 1

4
16
1
123456789012
1000000000000000000

Sample Output 1

5
1
4555793983
23561347048791096

In the first case, the following five sequences can result from the operations.

  • (16,4,2,1,1,1,)(16,4,2,1,1,1,\ldots)
  • (16,4,1,1,1,1,)(16,4,1,1,1,1,\ldots)
  • (16,3,1,1,1,1,)(16,3,1,1,1,1,\ldots)
  • (16,2,1,1,1,1,)(16,2,1,1,1,1,\ldots)
  • (16,1,1,1,1,1,)(16,1,1,1,1,1,\ldots)

update @ 2024/3/10 10:27:55