Composite and Prime
Submissions: 1545   Accuracy:

19.94%

  Difficulty: Medium   Marks: 4

Given two integers L and R find the difference of number of composites and primes between the range L and R (both inclusive).

Input:
First line of input contains of an integer 'T' denoting number of test cases . Then T test cases follow.
Each test contains two integers L and R .

 

Output:
For each case print an integer corresponding to the answer .


Constraints:
1<=T<=100
1<=L<=R<=10^7


Example:

Input:

2
4 4
4 6


Output:
1
1

 

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

Contributor: Hardik Gulati
Author: hardikgulati96


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.