Description
Given k,m,n, find:
i=m∑nj=i∏i+k−1aj
Take the answer modulo 109+7.
Here {a} is the Fibonacci sequence.
Three positive integers, representing k,m,n respectively.
Output one line with one integer, representing the answer.
4 1 3
276
3 2 3
36
Hint
a1=1,a2=1,a3=2,a4=3,a5=5,a6=8.
For Sample 1:
K=4
$$b_1=1\times1\times2\times3=6,b_2=1\times2\times3\times5=30,b_3=2\times3\times5\times8=240$$
i=1∑3bi=276
For Sample 2:
K=3
b2=1×2×3=6,b3=2×3×5=30
i=2∑3bi=36
This problem has 20 test points. Each test point is worth 5 points, for a total of 100 points. The properties of each test point are as follows:
(The problem setter does not want to use 4 to represent any number anymore! so true)
| ID |
Constraints on K,M,N |
Special Property |
| 1 |
1≤m≤n≤106,k=4 |
None |
| 2 |
1≤m≤n≤1018,k=4 |
n−m≤106 |
| 3∼4 |
None |
| 5∼6 |
1≤m≤n≤444,k=4 |
n−m≤106 |
| 7∼10 |
1≤m≤n≤447,k=4 |
None |
| 11∼12 |
1≤m≤n≤46000,2≤k≤10 |
| 13∼14 |
1≤m≤n≤1041,2≤k≤10 |
| 15∼20 |
1≤m≤n≤1041,2≤k≤50 |
(Note: the Constraints described in the statement are only approximate. Please refer to the specific ranges above.)
abc=a(bc)
Three positive integers, representing k,m,n respectively.
Output one line with one integer, representing the answer.
Hint
a1=1,a2=1,a3=2,a4=3,a5=5,a6=8。
For Sample 1:
K=4
$$b_1=1\times1\times2\times3=6,b_2=1\times2\times3\times5=30,b_3=2\times3\times5\times8=240$$
i=1∑3bi=276
For Sample 2:
K=3
b2=1×2×3=6,b3=2×3×5=30
i=2∑3bi=36
This problem has 20 test points. Each test point is worth 5 points, for a total of 100 points. The properties of each test point are as follows:
(The problem setter does not want to use 4 to represent any number anymore! so true)
| ID |
Constraints on K,M,N |
Special Property |
| 1 |
1≤m≤n≤106,k=4 |
None |
| 2 |
1≤m≤n≤1018,k=4 |
n−m≤106 |
| 3∼4 |
None |
| 5∼6 |
1≤m≤n≤444,k=4 |
n−m≤106 |
| 7∼10 |
1≤m≤n≤447,k=4 |
None |
| 11∼12 |
1≤m≤n≤46000,2≤k≤10 |
| 13∼14 |
1≤m≤n≤1041,2≤k≤10 |
| 15∼20 |
1≤m≤n≤1041,2≤k≤50 |
(Note: the Constraints described in the statement are only approximate. Please refer to the specific ranges above.)
abc=a(bc)
Translated by ChatGPT 5