BETA

Difficulty Level: Medium

Submissions: 944 Accuracy:

16.21%

Composite and Prime
       

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

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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