probable-primes-2
Source: hackerearth
Difficulty: EASY

Sam and his girl fiend went on a date. There is a sequence of numbers from 1 to 1000000. Sam picked a sub sequence SS and wants his friend to pick a number from SS. What is the probability that the number picked was a prime number.

Input Format

First Line of input contains T , number of test cases and next T lines contains L and R , the starting number and ending number of the sequence

Output Format

Print the answer with up to 6 digits after the decimal point.

Constraints

1 ≤ T ≤ 100000

1 ≤ L ≤ R ≤ 1000000
Register for IndiaHacksSAMPLE INPUT
2
1 10
3 3

SAMPLE OUTPUT
0.400000
1.000000

Register for IndiaHacks