Count Numbers in Range
Submissions: 1224   Accuracy:

26.03%

  Difficulty: Medium   Marks: 4

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


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



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


to report an issue on this page.