Gangsan took up archery as a hobby after watching the 2012 London Olympics. Archery turned out to be harder than he expected. His aim never improved much, so he wrote the rules for a far easier version of the sport.
Consider a game with two targets. Some directions pierce both targets with one shot, others pierce only one target, and others hit nothing at all. Gangsan found it more fun to work out how many targets one arrow would hit than to shoot the bow himself.
Given the two endpoints of each target, compute the expected number of targets that one arrow pierces.
The first line contains the number of test cases T. (1≤T≤100)
The first line of each test case contains the number of targets N. (1≤N≤100)
Each of the next N lines contains the integers X1, Y1, X2, Y2 separated by spaces. That target is the segment running from (X1,Y1) to (X2,Y2). (−100≤X1,Y1,X2,Y2≤100)
For each test case, print on one line the expected number of targets that one arrow pierces. Round at the sixth decimal place and write five decimal places. The judge data contains no value whose rounding is ambiguous.