Numere magice

Time limit: 0.1s Memory limit: 64MB Input: Output:

Gomory has just studied Goldbach’s conjecture, which sparked his interest in prime numbers. Now, together with Hu, he is asking several questions related to numbers contained in certain intervals.

Task

You are given multiple queries of the form: “How many numbers with 33 odd divisors are in the range [l,r][l,r]?”.
You must output the answer to each query, on a separate line.

Input Data

From the first line, an integer QQ will be read, representing the number of queries.

From each of the next QQ lines, two numbers separated by a space will be read, the first representing the left endpoint of the query, and the second representing the right endpoint of the query.

Output Data

You must output QQ lines. The ii-th line must contain a single number representing the answer to the ii-th query.

Constraints

  • Q10000Q \leq 10\,000
  • 1liri10121 \leq l_i \leq r_i \leq 10^{12}, for each ii from 11 to QQ
# Points Restrictions
1 40 1li,ri10001 \le l_i, r_i \le 1\,000
2 60 No additional constraints

Example

stdin

1
1 20

stdout

2

Explanation

In the range [1, 20][1,\ 20] there are only two numbers with 33 odd divisors. These are 9 and 18. Their divisors are: 11, 33, 99; respectively: 11, 22, 33, 66, 99, 1818.

Log in or sign up to be able to send submissions!