#P2004. Fibonacci sequence
Fibonacci sequence
A simple math problem
Description
As we all known,Fibonacci sequence is a sequence that fits all the requirances below:
•
•
• ( and )
Please give the value of .
Input format
You should input lines.
The first line is a number , which means you should solve cases .
Then , for each case :
- Line 1 : a number 。
- Line 2 : a number 。
Output format
You should output line(s).
- for each case : Output the value of .
Sample#1
Input Sample #1
1
5
1000000007
Output Sample #1
5
Sample #2
Input Sample #2
1
10
1000000007
Output Sample #2
55
Sample #3
Input Sample #3
10
1000000000000000000000000000000000000000000000000000000 12345
123456789098765432100 23
824935764392407465923 7843259
2934578023950234780293486780923675029378602398670293876 96753
83264589023954810 43
37294587948326591354 847356
57623487867543589 43255643354
56782222222222228364591853918549110495732510934571593720135420159509437 123456789
346567589865446786654678978654 465789
46567897654354987 3498
Output Sample #3
8940
17
4093606
60567
12
19633
22452383807
37156508
459248
959
Hint
For data :
For data :
For data :
Limit
- Time limit 1.00s - 3.00s
- Memory limit 128Mbit