The segments
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Two line segments are given on the plane. Each segment is parallel to either the X axis or the Y axis. Figure out how the segments intersect.
Input
Each of two lines contains four integers: x[1]
, y[1]
, x[2]
, y[2]
(-1000 ≤ x[1]
, y[1]
, x[2]
, y[2]
≤ 1000) - the coordinates of segment endpoints.
Output
Print one of the next words:
"NO" - if the segments do not intersect;
"POINT" - if the segments' intersection forms a point;
"SEGMENT" - if the segments' intersection forms a line segment.
Examples
Input #1
Answer #1
Submissions 713
Acceptance rate 13%