#D3220. Sum of Fibonacci Sequence
Sum of Fibonacci Sequence
Sum of Fibonacci Sequence
E869120 defined a sequence like this:
- ,
He also defined sequences , as the following recurrence relation :
You are given integers and . Please calculate the value of . Since the answer can be large number, print the answer modulo . Can you solve this problem???
Input
The input is given from standard input in the following format.
Output
- Print modulo .
Constraints
Subtasks
Subtask 1 [ points ]
- The testcase in this subtask satisfies .
Subtask 2 [ points ]
- The testcase in this subtask satisfies .
Subtask 3 [ points ]
- The testcase in this subtask satisfies .
Subtask 4 [ points ]
- The testcase in this subtask satisfies .
Subtask 5 [ points ]
- There are no additional constraints.
Output
- Print modulo .
Constraints
Subtasks
Subtask 1 [ points ]
- The testcase in this subtask satisfies .
Subtask 2 [ points ]
- The testcase in this subtask satisfies .
Subtask 3 [ points ]
- The testcase in this subtask satisfies .
Subtask 4 [ points ]
- The testcase in this subtask satisfies .
Subtask 5 [ points ]
- There are no additional constraints.
Input
The input is given from standard input in the following format.
Examples
Input
4 7
Output
176
Input
12 20
Output
174174144
Input
16 30
Output
102292850
inputFormat
Input
The input is given from standard input in the following format.
outputFormat
Output
- Print modulo .
Constraints
Subtasks
Subtask 1 [ points ]
- The testcase in this subtask satisfies .
Subtask 2 [ points ]
- The testcase in this subtask satisfies .
Subtask 3 [ points ]
- The testcase in this subtask satisfies .
Subtask 4 [ points ]
- The testcase in this subtask satisfies .
Subtask 5 [ points ]
- There are no additional constraints.
Output
- Print modulo .
Constraints
Subtasks
Subtask 1 [ points ]
- The testcase in this subtask satisfies .
Subtask 2 [ points ]
- The testcase in this subtask satisfies .
Subtask 3 [ points ]
- The testcase in this subtask satisfies .
Subtask 4 [ points ]
- The testcase in this subtask satisfies .
Subtask 5 [ points ]
- There are no additional constraints.
Input
The input is given from standard input in the following format.
Examples
Input
4 7
Output
176
Input
12 20
Output
174174144
Input
16 30
Output
102292850
样例
4 7
176