Count The Prime
All submissions for this problem are available.
Semusa wants to generate Prime Number for his cryptosystem. As Prime Numbers are bare-bones of any cryptosystem, Semusa is baffled with his approach in finding the prime numbers and counting the prime numbers between two given integers.
As you are a good programmer, he wants your help in counting the number of Prime Numbers between any two given integers x1 and x2 (inclusive of both)
- The first line of the input contains an integer T denoting the number of test cases.
- Each test case contains two integers x1 and x2separated by a space
- For each test case, output a single line containing the number of prime numbers between x1 and x2 inclusive of both.
Should contain all the constraints on the input data that you may have. Format it like:
- 1 ≤ T ≤ 100
Input: 3 2 10 3 65 53 59 Output: 4 17 2
Example case 1. Prime numbers between 2 and 10 are 2, 3, 5, 7 hence output is 4
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
Fetching successful submissions