#arc112a. [arc112_a]B = C

[arc112_a]B = C

Problem Statement

How many triples A,B,CA,B,C of integers between LL and RR (inclusive) satisfy AB=CA-B=C?

You will be given TT cases. Solve each of them.

Constraints

  • 1leqTleq2times1041 \\leq T \\leq 2\\times 10^4
  • 0leLleRle1060\\le L \\le R \\le 10^6
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

TT textcase1\\text{case}_1 vdots\\vdots textcaseT\\text{case}_T

Each case is in the following format:

LL RR

Output

Print TT values; the ii-th of them should be the answer for textcasei\\text{case}_i.


Sample Input 1

5
2 6
0 0
1000000 1000000
12345 67890
0 1000000

Sample Output 1

6
1
0
933184801
500001500001

In the first case, we have the following six triples:

  • 42=24 - 2 = 2
  • 52=35 - 2 = 3
  • 53=25 - 3 = 2
  • 62=46 - 2 = 4
  • 63=36 - 3 = 3
  • 64=26 - 4 = 2