Isolated Segments

You’re given n segments in the rectangular coordinate system. The segments are defined by start and end points (Xi,Yi) and (Xj,Yj) (1 ≤ i,j ≤ n). Coordinates of these points are integer numbers with real value smaller then 1000. Length of each segment is positive. When 2 segments don’t have a common point then it is said that segments don’t collide. In any other case segments collide. Be aware that segments collide even if they have only one point in common. Segment is said to be isolated if it doesn’t collide with all the other segments that are given, i.e. segment i is isolated when for each 1 ≤ j ≤ n, (i ̸= j), segments i and j don’t collide. You are asked to find number T — how many segments are isolated. Input First line of input contains number N (N ≤ 50), then tests follow. First line of each test case contains number M (M ≤ 100) — the number of segments for this test case to be considered. For this particular test case M lines follow each containing a description of one segment. Segment is described by 2 points: start point (Xpi,Ypi) and end point (Xei,Yei). They are given in such order: Xpi Ypi Xei Yei Output For each test case output one line containing number T. Sample Input 6 3 0020 1 -1 1 1 2233 2 0011 1001 2 0001 0203 2 0010 1020 2 0022 1011 2 1315 1016 Sample Output 1 0

2/2 2 0 0 0