Composite and Prime
Medium Accuracy: 17.64% Submissions: 3178 Points: 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

 

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.