Fibonacci Sequence:
Fibonacci representation : Any natural number can be expressed as the sum of a set of different Fibonacci numbers.
In particular: and are two different Fibonacci numbers.
For example: indicates that corresponds to at least two Fibonacci representations.
The value of the Fibonacci representation : defined as the product of the Fibonacci numbers in the representation .
For example: . In this representation, the value is: .
With the above definitions, now, find the sum of all Fibonacci representations’ value of a given number .
To simplify the question, please output the answer modulo lovely .
输入
The first line contains a positive integer .
The next line, each line has a natural number .
输出
The output should contain lines, each line with an integer, which represents the value of the answer modulo lovely .
样例
标准输入 复制文本 |
1 7 |
标准输出 复制文本 |
21 |
提示
, then
来源
2021 GDCPC 广东省大学生程序设计竞赛