harry-and-probability

Harry is doing magic practice on X axis.He found 4 points A,B,C,D. Now consider line AB and CD ( |AB|=|CD| ) , he guesses an angle alpha and rotates line segment AB by angle alpha keeping B as center. He found that line segment CD also started rotating anti clock wise keeping center as C and by angle alpha. Now he wants to find probability of intersection of both line segments. 

Input :
First line contains T- no. of test cases.
Next T line contains 4 space separated integers - A, B, C, D.  which are x co ordinates of 4 points.  

Output :
Print required probability with exact 6 decimal places.  

Constraints :
1 ≤ T ≤ 10^5
0 ≤ A,B,C,D ≤10^15
A < B < C < D  

SAMPLE INPUT
2
1 2 5 6
1 2 3 4

SAMPLE OUTPUT
0.000000
0.333333

Source: hackerearth | Difficulty: EASY


Solutions: