Find the number of ordered positive pairs $$(B, C)$$ such that the equation $$ x^2 - 2Bx + C = 0$$ has integral roots and $$C$$ lies between $$L$$ and $$R$$ both inclusive.
Input format
- The first line contains a single integer $$T$$ denoting the number of test cases.
- The first line of each test case contains two space-separated integers $$L$$ and $$R$$ denoting the range of $$C$$.
Output format
For each test case, print a single integer denoting the number of ordered positive pairs possible. The output for each test case must be printed in a separate line.
Constraints
$$1 \leq T \leq 10$$
$$1 \leq L, R \leq 10^{12}$$
The valid pairs corresponding to the first test case is: (1, 1), (2, 3), (2, 4), (3, 5).
The valid pairs corresponding to the second test case is: (2, 3), (2, 4), (3, 5), (4, 7), (3, 8), (3, 9), (5, 9).
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor