P21484 [HackerEarth] 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 keepin
普及-
题目描述

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

输入格式

见题面

输出格式

见题面

样例输入
100 1 2 4 5 1047669470 1537684409 1775448745 2265463684 1860430620 2107055858 4042482395 4289107633 1317023953 1409753263 2054649411 2147378721 1655693840 2551102033 2783674211 3679082404 949958172 2816421785 4103997495 5970461108 1713720064 2477558398 3875330310 4639168644 624407316 2376225853 2764387332 4516205869 1390142129 3178644751 4887348292 6675850914 53637028 1526042952 1880128353 3352534277 87092476 773110424 1154180018 1840197966 398247405 2131934824 3003019357 4736706776 636011740 2082646131 3200355901 4646990292 423954628 1040129324 2250568404 2866743100 1068850776 1193235664 3299082936 3423467824 1301422953 2375766013 4200593249 5274936309 441515014 1082094490 1523276411 2163855887 1839286925 3104273718 3149790527 4414777320 79964755 587610029 2421629459 2929274733 1788668295 2349950598 3508892304 4070174607 2142753695 2791128474 4636088127 5284462906 376339641 1422961826 2854125249 3900747434 1247424173 2930058098 3660372264 5343006189 217650294 2324238848 3670727709 5777316263 1428089373 2456045055 3926918804 4954874486 1386452997 1568347984 1966081144 2147976131 1063796584 1687206585 2725519221 3348929222 1504978505 1820191784 1976007564 2291220843 1550495313 1945673347 2609134400 3004312434 1237031095 1273393777 2498137132 2534499814 248489152 280121881 2153240015 2184872744 2093448804 2501421174 3273677844 3681650214 1377128579 3032525122 3339932068 4995328611 2107442744 3980489582 4247001433 6120048271 1306447956 2460100519 3754568051 4908220614 629838056 1022459968 2498822486 2891444398 1027571216 2483989713 4583762232 6040180729 2065883851 2879797205 3147299354 3961212708 74215982 291141001 953821183 1170746202 737677034 2191633148 2890676011 4344632125 1962420389 3664865655 4395541247 6097986513 1688054874 3336465297 4475113258 6123523681 312827895 1190883249 1837444105 2715499459 620234840 1458249290 1830373335 2668387785 886746691 3031209097 4556985704 6701448110 33730574 660547389 2578945908 3205762723 1510093092 3164481123 4391814490 6046202521 1462381962 3035170196 5076416916 6649205150 1729884110 3376888326 3487576416 5134580632 245080643 482278245 2046922449 2284120051 944123506 996257849 2115863670 2167998013 1674799097 3414988314 4035520909 5775710126 665963409 2718980521 4217568469 6270585581 1312524264 1838292569 2027411318 2553179623 1684648308 3097163304 3283260811 4695775807 1062941267 2509186837 3322101158 4768346728 833856137 1642711151 1962529854 2771384868 2061189503 2184942831 4077549767 4201303095 1954952574 3808590012 5200717515 7054354953 2065640663 4164358745 5793683849 7892401931 1482801218 2378159158 4059618605 4954976545 454923391 877596780 2151761795 2574435184 1075455985 2164092783 3343791262 4432428060 426560285 680237700 2385704483 2639381898 615679033 2554004756 3524502886 5462828609 801776539 1655559881 1924819932 2778603274 1614690859 3302330338 4380445403 6068084882 1934509561 3535854895 4737723287 6339068621 1679632848 3088447108 3996469290 5405283550 924276702 2251247978 3110504593 4437475869 406118158 1068407004 2823021558 3485310404 2087577604 3204789841 3234594135 4351806372 1214258970 1259443545 2377884636 2423069211 246473800 718218660 2090337165 2562082025 1951940582 3039364475 4202325055 5289748948 774955063 2664155496 4680899417 6570099850 1044215114 2400622758 3957522510 5313930154 2122330178 3265763736 4276525173 5419958731 1176714921 1852297679 2124389728 2799972486 2084737102 3684596563 5283659887 6883519348 796510068 2802487687 2916356208 4922333827 403640973 2349712548 3580793306 5526864881 433445266 1446292163 2722557495 3735404392 1551886357 2811207055 4559217246 5818537944 776521213 1840298845 2528249280 3592026912 1939481792 3778214488 4207881707 6046614403 1808742065 2544206227 4330281090 5065745252 1218158168 1928468860 2710493632 3420804324 81435956 1968461569 3426069098 5313094711 353528004 2177807072 3087790413 4912069481 1952591327 2425896815 3194374126 3667679614 2066459848 2943406310 3510471547 4387418009 1150056957 2460448685 4040360819 5350752547 278838640 993633077 1685382260 2400176697 2026848830 3518164481 5273691295 6765006946 567315616 1850629411 3297405272 4580719067 996982835 1941555047 1976311421 2920883633 635574049 650820781 1395887846 1411134578 1417598820 1514281509 1998890539 2095573228 727722700 1177933393 1339337842 1789548535
样例输出
0.482763 0.265091 0.000000 0.000000 0.371217 0.172828 0.468936 0.439085 0.319340 0.337092