#P387. 练67.1 斐波那契数列
练67.1 斐波那契数列
Description
The Fibonacci sequence is defined as follows: the first and second numbers are both , and each subsequent number is the sum of the previous two numbers. Given a positive integer , find the -th number in the Fibonacci sequence modulo .
Input Format
The first line contains the number of test cases , followed by lines of input. Each test case consists of a single line with a positive integer ().
Output Format
Output lines, each containing the result for the corresponding input. The output should be a positive integer, which is the -th Fibonacci number modulo .
Sample
4
5
2
19
15
1
181
1