#t58. Fibonacci 数列
Fibonacci 数列
Fibonacci Sequence
Problem Description
The Fibonacci sequence is defined by the recurrence , with .
When is large, is also very large. We now want to know the remainder of divided by .
Input Format
One integer ().
Output Format
Output one line containing an integer: the remainder of divided by .
Sample Input 1
10
Sample Output 1
55
Sample Input 2
22
Sample Output 2
7704
Hint
In this problem the answer is the remainder of divided by , so we only need to compute that remainder — there is no need to first compute the exact value of and then divide it by to take the remainder. Computing the remainder directly is usually much simpler than computing the original number first and then taking the remainder.