Count Primes In Range
Submissions: 1005   Accuracy:

13.37%

  Difficulty: Easy   Marks: 2

Given a range [L,R] , we need to find the count of total numbers of prime numbers in the the range [L,R].

Input:
The first line of the input contains an integer Q, denoting the number of queries. Each of the queries contains two integers L and R.

Output:
For each query, print the total numbers of prime in the given range.

Constraints:
1<=Q<=10^4
1<=L<=R<=10^5

Example:
Input

2
1 10
5 10
Output
4
2
Note: Time Limit: 0.6 seconds

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

Author: ShivamKD


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.