Do two line segments intersect? ------------------------------- Given two line segments, do they intersect? That is, does there exist a point that is part of both line segments. A line segment is represented by its end points. A point is represented by its x- and y-coordinates. Input ----- The input begins with a single positive integer on a line by itself indicating the number of cases following, each of them on a line as described below. Each case is described by eight integers x0, y0, ..., x3, y3. (x0, y0) and (x1, y1) represent the end points of one line segment and (x2, y2) and (x3, y3) represent the end points of the other line segment. Output ------ For each test case, the output is true if the line segments intersect and false otherwise. Sample input ------------ 4 1 1 3 3 2 2 2 2 1 1 2 2 2 2 3 3 1 1 3 1 1 2 3 2 1 1 1 1 1 1 1 1 Sample output ------------- true true false true