Count Numbers in Range
Submissions: 917   Accuracy:

26.47%

  Difficulty: Medium
         

Given two positive integers L and R, return count of numbers having exactly 3 divisors from L to R inclusive.

Input:

The first line of the input contains T denoting the number of testcases. Each of the next T lines contains two space separated positive integers denoting the values of L and R respectively.


Output:

For each testcase, print the answer in a separate line.


Constraints:

1 <= T <=1000
1 <= L <= R <=109


Example:

Input:
1
1 10

Output:
2

Explanation:

In the given example, two numbers having exactly 3 divisors are 4 and 9.

** For More Input/Output Examples Use 'Expected Output' option **

Author: dipjal1996


Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.