Mani wants to eat chocolates, but her brother Pane does not give her the chocolates easily. Pane being a mathematician wants to teach Mani an important concept. Pane makes Mani stand on an infinite straight line. He marks all integers at equal divisions on the line and places chocolates on the integer X.

Initially Mani is on an integer Z. Mani can jump forward or backward from any general integer K. Pane being a mischievous brother puts a constraint that Mani can jump forward or backward only A, B or C integers i.e from any general integer K there are 6 possible moves (K+A, K-A, K+B, K-B, K+C, K-C). Pane gives Mani the liberty to choose distinct A, B and C in the range [1,100]. Find the probability that Mani succeeds in reaching the chocolates. Note that Mani is really clever and if she can reach the chocolates, she will.

Input :

First line contains an integer T containing test cases.
Each test case consists of a single line with two integers X and Z.

Output :

A single line for each test case having the answer rounded off to exactly 6 digits after the decimal.

Constraints :

1 ≤ T ≤ 10^5

1 ≤ X,Z ≤ 2 * 10^18

1 ≤ A,B,C ≤ 100

Author : Sayan

Tester : Shreyans

(By IIT Kgp HackerEarth Programming Club)

SAMPLE INPUT
3
2 10
15758 29586685
1000 1000000000

SAMPLE OUTPUT
0.956092
0.839450
0.999716
def gcd(a,b):
	if(a==0):
		return b;
	elif(b==0):
		return a;
	elif(a>b):
		return gcd(a%b,b);
	else:
		return gcd(a,b%a);


dp=[];
g = 0;
g1 = 0;
su = 0;
for i in range(102):
	dp.append(0);

for i in range(1,101):
	for j in range(i+1,101):
		g = gcd(i,j);
		for k in range(j+1,101):
			g1 = gcd(g,k);
			dp[g1] = dp[g1]+1;
			su = su+1;

su = float(su);

t = input();

for i in range(t):
	a,b = raw_input().split();
	a,b = int(a),int(b);
	s = 0;
	x = max(a,b)-min(a,b);
	for j in range(1,101):
		if(x%j==0):
			s = s + dp[j];
	s = float(s);
	print "%.6f" %(s/su);