Nobita's Love for Shizuka
Time Limit: 1.0 s
Memory Limit: 512.0 MB
Description
Nobita and Shizuka are two famous characters everyone knows. Nobita has fallen in love with Shizuka and wants her to notice him. Today, Shizuka will visit a few of her friends house, forming a non-intersecting cycle starting and ending at her house. Her journey is made up of straight paths connecting a series of stops. Note: The first coordinate is the house of Shizuka.
Nobita wants to stand somewhere inside her path so that she notices him. However, Shizuka will only notice Nobita if he is standing strictly inside the area enclosed by her path.
Your job is to help Nobita. You are given the \(2D\) coordinates of Shizuka’s stops in the order she visits them. You are also given the coordinates of Nobita’s position. Determine if Shizuka will notice Nobita.
Input
- The first line contains an integer \(n(3 ≤ n ≤ 10^3)\), the total number of coordinates that define Shizuka's stops.
- The next \(n\) lines each contain two integers \(x\) and \(y\) (\(-10^3 ≤ x_i, y_i ≤ 10^3\)), representing the \(2D\) coordinates of Shizuka's stops in the order she visits them.
- The last line contains two integers \(x_p\) and \(y_p\) (\(-10^3 ≤ x_p, y_p ≤ 10^3\)), representing the coordinates of Nobita’s position.
Output
Output "YES" if Shizuka notices Nobita; otherwise, output "NO."
Sample
Input | Output |
---|---|
|
|
Information
- ID
- 1145
- Difficulty
- 9
- Category
- (None)
- Tags
- (None)
- # Submissions
- 120
- Accepted
- 8
- Accepted Ratio
- 7%
- Uploaded By
Related
In following contests: