Line Segment Intersection

medium
https://cses.fi/problemset/task/2190/

Input Format

Check Link

Output Format

Check Link

Constraints

Check Link

Example

Input
5
1 1 5 3 1 2 4 3
1 1 5 3 1 1 4 3
1 1 5 3 2 3 4 1
1 1 5 3 2 4 4 1
1 1 5 3 3 2 7 4
Output
NO
YES
YES
YES
YES
Previous
Point Location Test
Next
Polygon Area

Related Questions