#icpc2014springf. [icpc2014spring_f]Polygon Guards
[icpc2014spring_f]Polygon Guards
MathJax.Hub.Config({ tex2jax: { inlineMath: [[""], ["\\(","\\)"]], processEscapes: true }}); blockquote { font-family: Menlo, Monaco, "Courier New", monospace; color: #333333; display: block; padding: 8.5px; margin: 0 0 9px; font-size: 12px; line-height: 18px; background-color: #f5f5f5; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; white-space: pre; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; }
Problem Statement
You are an IT system administrator in the Ministry of Defense of Polygon Country.
Polygon Country's border forms the polygon with vertices. Drawn on the 2D-plane, all of its vertices are at the lattice points and all of its edges are parallel with either the -axis or the -axis.
In order to prevent enemies from invading the country, it is surrounded by very strong defense walls along its border. However, on the vertices, the junctions of walls have unavoidable structural weaknesses. Therefore, enemies might attack and invade from the vertices.
To observe the vertices and find an invasion by enemies as soon as possible, the ministry decided to hire some guards. The ministry plans to locate them on some vertices such that all the vertices are observed by at least one guard. A guard at the vertex can observe a vertex if the entire segment connecting and is inside or on the edge of Polygon Country. Of course, guards can observe the vertices they are located on. And a guard can observe simultaneously all the vertices he or she can observe.
To reduce the defense expense, the ministry wants to minimize the number of guards. Your task is to calculate the minimum number of guards required to observe all the vertices of Polygon Country.
Input
The input is formatted as follows.
:
:
The first line contains an even integer (). The following lines describe the vertices of Polygon Country. Each of the lines contains two integers, and (, , ), separated by one space. The position of the -th vertex is .
If is odd, , . Otherwise, , . Here, we regard that , and . The vertices are given in counterclockwise order under the coordinate system that the -axis goes right, and the -axis goes up. The shape of Polygon Country is simple. That is, each edge doesn’t share any points with other edges except that its both end points are shared with its neighbor edges.
Output
Print the minimum number of guards in one line.
Sample Input 1
8
0 2
0 0
2 0
2 1
3 1
3 3
1 3
1 2```
### Output for the Sample Input 1
```plain
1```
* * *
### Sample Input 2
```plain
12
0 0
0 -13
3 -13
3 -10
10 -10
10 10
-1 10
-1 13
-4 13
-4 10
-10 10
-10 0```
### Output for the Sample Input 2
```plain
2```
* * *
### Source Name
[Japan Alumni Group Spring Contest 2014](http://acm-icpc.aitea.net/index.php?2013%2FPractice%2F%BD%D5%A5%B3%A5%F3%A5%C6%A5%B9%A5%C8%2F%B0%C6%C6%E2)
* * *