#abc243g. G - Sqrt
G - Sqrt
Score : points
问题陈述
我们有一个长度为 的序列:。让我们对这个序列执行以下操作 次。
操作:令 为 尾部的元素。从 到 (包含)之间选择一个整数,并将其追加到 的末尾。
经过 次操作后,可以得到多少种不同的序列?
你将得到 个测试用例需要解决。
在约束条件下,可以证明答案小于 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
We have a sequence of length : . Let us perform the following operation on this sequence times.
Operation: Let be the element at the end of . Choose an integer between and (inclusive), and append it to the end of .
How many sequences are there that can result from operations?
You will be given test cases to solve.
It can be proved that the answer is less than under the Constraints.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Each case is in the following format:
Output
Print lines. The -th line should contain the answer for .
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.
update @ 2024/3/10 10:27:55