11969 - Prime   

Description

Output the number of primes between two given integer a and b.

Input

The first line of input contains a positive integer t (t<=1000), which indicates the numbers of test cases in the input. In the next t line, each line contains two positive integers a, b(1 <= a <= b <= 10000), indicating the range between a and b.

Output

Output the number of primes in the range between a and b (including a and b).

Sample Input  Download

Sample Output  Download

Tags




Discuss