
Princess Ale has been captured by Empress Khan, who wants to use her hair for a magic potion. The Empress locks Ale up in a special prison. Fortunately, Claudiu Codreanu, the Princess's best friend, wants to help her escape!
Princess Ale, like all princesses, is shaped like a polygon (not necessarily convex), with sides. The Empress's prison is also shaped like a polygon, having walls that perfectly wrap around the princess's sides all the way around. Let's assume that the walls overlap perfectly with Ale's sides, and Claudiu Codreanu wants to prove that he can free the princess with minimal effort. He proposes that the princess can free herself by destroying a single wall of the prison, and you are the ones who have to give him a reality check and say whether this is actually possible or not. After destroying a wall, the princess will free herself through a sequence of translation and rotation moves. (Formally, the goal is for her to reach an arbitrarily large distance from the remaining walls).
Implementation Details
You must implement the function
bool can_escape(std::vector<int> x, std::vector<int> y);
The polygon has points given in counterclockwise order: , , . The function returns a single boolean value: true if the answer is Yes and false otherwise.
The judge may call the function multiple times within the same test.
Constraints and Notes
- .
- Let be the sum of the values of over all calls to the function within the test.
- The polygon does not self-intersect, does not self-touch, and has no consecutive collinear vertices.
- The maximum absolute value of the coordinates is .
| # | Score | Constraints |
|---|---|---|
| 1 | 2 | |
| 2 | 11 | and the polygon is convex. |
| 3 | 19 | The polygon is convex |
| 4 | 18 | |
| 5 | 21 | |
| 6 | 29 | No additional restrictions. |
Example 1
input
1
7
3 12
6 2
9 8
12 -2
18 6
21 2
23 12
output
Test 1: 1
Explanation
See the drawing in the statement.