You are given a sequence whose first and the second elements are 0 and 1 respectively.
The ith element of sequence is given by:
bi = (−1)i+1 * [|bi−1|+|bi−2|]
where |K| represents the absolute value of K. If the element is very large, take modulo with 109+7.
Write a program to find the sum of the sequence having indexes between L and R (L and R inclusive). If the answer is very large, output it as modulo 109+7. It is guaranteed that result will always be positive.
Input Format
First line: T, the number of test cases
Next T lines: L and R
Output Format
For each test case, output an integer which is the sum of all elements having indexes between L and R of the given sequence.
Input Constraints:
1≤T≤104
0≤L≤1015
L≤R≤1015
0-based indexing is followed.
The sequence is: 0,1,-1,2. The sum from index 2 to 3 is 1. The sum from index 1 to 1 is 1.