P14945 [HackerEarth] Alice and Bob are playing a game. They choose some subset of integers from A to B (including A and B). Let us call this subset T. The players alternate turns, with Alice being the first
提高
题目描述

Alice and Bob are playing a game. They choose some subset of integers from A to B (including A and B). Let us call this subset T. The players alternate turns, with Alice being the first to play. In each turn player will choose a number from T and replace it with one of its factor such that the number being replaced is less than the original number. Note that T can have multiple identical elements at some point in the game. If a player cannot make a move, he will lose.

For given numbers A and B, Alice wants to know the number of subsets T such that he will win the game always. If both the players play optimally, count the number of such subsets.

Input
First line of the input contains the number of test cases T. It is followed by T lines. Each line contains two space separated integers A and B.

Output
For each test case print a single number, the number of sucn subsets. As the answer can be large, print the answer modulo 1000000007.

Constraints
1 ≤ T ≤ 10
1 ≤ A ≤ B ≤ 10^10
B - A ≤ 10^5

Read the editorial here.

SAMPLE INPUT
4
1 5
3 10
2 4
5 15

SAMPLE OUTPUT
24
192
6
1536

输入格式

见题面

输出格式

见题面

样例输入
10 2100279713 2100307426 8334360451 8334370196 6157268525 6157330528 367891985 367912842 6097275990 6097329997 3912651081 3912690935 9471959111 9471991097 4776487368 4776550770 4733996841 4734065445 7623083736 7623084537
样例输出
895515694 497418833 792887778 921293285 841684506 534159718 308287509 159044529 97097571 20796263