4578 B

时间限制1 S
内存限制128 MB
通过率0%(0 / 2)
题目描述

Fibonacci Sequence:

f0= 1 (1)

f= 1 (2)

fi = fi-1+ fi-2, i ≥ 2 (3)

Fibonacci representation F(x): Any natural number x can be expressed as the sum of a set of different Fibonacci numbers.

In particular: f0 and f1 are two different Fibonacci numbers.

For example: 7 = 5 + 2 = f4 + f2, 7 = 3 + 2 + 1 + 1 = f3+ f2 + f1 + f0 indicates that 7 corresponds to at least two Fibonacci representations.

The value of the Fibonacci representation w(F(x)): defined as the product of the Fibonacci numbers in the representation .

For example: 7 = 3 + 2 + 1 + 1 = f3 + f2 + f1 + f0. In this representation, the value w(F(x)) is: 3 ∗ 2 ∗ 1 ∗ 1 = 6.

With the above definitions, now, find the sum of all Fibonacci representations’ value of a given number x.

To simplify the question, please output the answer modulo lovely 998244353

输入格式

The first line contains a positive integer T(1 ≤ T ≤ 1e6).

The next T line, each line has a natural number n(1 ≤ n ≤ 1e7)

输出格式
The output should contain T lines, each line with an integer, which represents the value of the answer modulo lovely 998244353.
输入输出样例
输入复制
1
7
输出复制
21
数据范围与提示
7=5+2=5+1+1=3+2+1+1, then 5 * 2+5 * 1 * 1+3 * 2 * 1 * 1=21
上传者
提交记录查看记录
题目类型传统
评测方式Special Judge
提交 / 通过2 / 0
相关讨论
暂无讨论