Intersection of line segments
Given two line segments, AB and CD, your task is to find the set of points where these segments intersect.
Input
The input consists of eight integers, each with an absolute value not exceeding 10^4. These integers represent the coordinates of points A, B, C, and D. Note that the points can overlap, including at the endpoints of a segment.
Output
If the segments do not intersect, output the word Empty. If they intersect at a single point, output the coordinates of this intersection point as two numbers. If the intersection forms a segment, output the coordinates of the two endpoints of this segment in lexicographical order. This means you should first list the point with the smaller x coordinate, and if the x coordinates are equal, then the point with the smaller y coordinate. Ensure all numbers are printed with a precision of at least 6 decimal places.