PRS

0

0 votes
Medium
Problem

On the world of PRos exists different type of numbers but for the our friend Angel there are some special numbers called PRS numbers .

A PRS number is the sum of two different prime numbers that falls in love. For example 5 is a PRS number (5=3+2) but 4 is not a PRS number.

Angel needs to know how many PRS numbers are between a range [s,f] inclusively.

Input

The first line contains an integer T ( 0T100000 ) representing the number of test cases, the next T lines represent a test case, each test case contains one line with S and F ( 0S<F100000 ).

Output

For each test case print the number of PRS between the range

Sample Input
7
0 0
1 1
2 4
4 6
4 8
9 10
8 10
Sample Output
0
0
0
1
3
2
3
Time Limit: 0.5
Memory Limit: 256
Source Limit:
Contributers:
Editor Image

?