Point location - MarisaOJ: Marisa Online Judge

Point location

Time limit: 1000 ms
Memory limit: 256 MB
Given a convex polygon of $n$ of vertices and a point $A(x_A, x_B)$. Determine if $A$ lies inside the polygon (lying on an edge is also counted as lying inside). ### Input - The first lines contains three integers $n, x_A, x_B$. - The next $n$ lines, each line contains a point $(x, y)$. The points are listed in the clockwise order. ### Output - Print `YES` if the point lies inside the polygon, otherwise print `NO`. ### Constraints - $ 1 \le n \le 1000$. - $-10^9 \le x, y \le 10^9$. ### Example Input: ``` 4 2 1 0 0 0 1 1 2 3 0 ``` Output: ``` YES ```