The Great Divisor!

0

0 votes
Easy
Problem

The problem statement is simple, given A and B, find the sum of maximum odd divisor of the numbers between A and B (inclusive).

INPUT:
There are several test cases per file. Each file begins with T, number of test cases and the next T lines contain two values A and B.

CONSTRAINTS:
1T105
1AB1018

For the 1st file, T100,B105.
For the 2nd file, T105,B105.
For the 3rd file, T105,B109.
For the 4th file, T105,B1018.

OUTPUT:
For each test case, print the answer. Since the answer can be huge, print it modulo 109+7.

Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

1+1+3=5
1+1+3+1=6
3+1+5+3+7+1+9=29

Editor Image

?