3069: 1237 Prime Twins

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:2 Solved:0

Description

如果n和n+2都是素数,我们称其为孪生素数,比如3和5,5和7都是孪生素数。 给你一个区间[a,b],请问期间有多少对孪生素数?

Input

第一行是一个整数K(K≤ 10000),表示样例的个数。 以后每行一个样例,为两个整数,a和b,1≤a≤b≤5000000

Output

每行输出一个样例的结果。

Sample Input Copy

5 
1 3 
1 10 
1 100 
1 1000 
1 5000000

Sample Output Copy

0 
2 
8 
35 
32463