There are some segments on the plane, we assume there 4 possible position concepts for every 2 segments: no common point, countless common points, one common point and the point is also the endpoint of either segment, one common point but the point is not the endpoint of either segment.

The first line of the input is an integer T, which represents that there are T test cases.An integer n indicating the number of segmentsn line follows, 4 integers per line, x1, y1, x2, y2, representing the coordinates of the endpoints of both segments .(1<=n<=100)

For each test case, please output 4 line, 1 integer per lineFor the first line, please output the number of pairs of segments that have no common pointFor the second line, please output the number of pairs of segments that have countless common pointFor the third line, please output the number of pairs of segments that have 1 common point and the point is also the endpoint of either segmentFor the fourth line, please output the number of pairs of segments that have 1 common point and the point is not the endpoint.After each case output a blank line include the last case。

提交代码