Point in polygon
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Determine if the point belongs to the polygon.
Input
The first row contains three numbers - n (3 ≤ n ≤ 100000) and the coordinates of the point. Next n lines contains a pair of numbers - the coordinates of another vertex of simple polygon in clockwise or counterclockwise order. All coordinates are integers not exceeding 10000 by absolute value.
Ouput
One line "YES", if the given point is contained in the given polygon or on its border, and "NO" otherwise.
Examples
Input #1
Answer #1
Submissions 4K
Acceptance rate 9%