#P15631. [2019 KAIST RUN Spring] Voronoi Diagram Again
[2019 KAIST RUN Spring] Voronoi Diagram Again
Problem Description
:::align{center}


Voronoi Diagram of size 4. :::
In the 2-dimensional Cartesian coordinate system, we define the of a non-empty set of points , as a diagram that divides the plane by the criteria "which point in the set is closest in this location?". More precisely, the Voronoi diagram of a given non-empty point set is a collection of : A point is included in region if and only if holds for all . Despite of usual Voronoi Diagram, we use taxicab distance in this problem. denotes the distance between point and . Taxicab distance between two points is the sum of the absolute differences of their Cartesian coordinates.
For example, in the picture above, every location over the plane is colored by the closest point with such location. The points which belongs to a single region is colored by a light color indicating a region, and the points which belongs to more than one region forms lines and points colored black.
We want to find the number of unbounded regions in Voronoi Diagram. The region is unbounded, if for any real number , there exists point in region such that where is origin.
Input Format
In the first line, the number of points consisting Voronoi diagram is given. ()
In the th line of next lines, two integers indicating and co-ordinate of are given. These are the points consisting the Voronoi diagram. All points are distinct. ()
Output Format
Output consists of single line, which consists of one integer. This should be the number of unbounded regions of Voronoi Diagram
4
0 0
-4 0
3 4
4 -2
4
5
1 1
2 2
3 3
4 4
5 5
5
9
-4 -4
-4 0
-4 4
0 -4
0 0
0 4
4 -4
4 0
4 4
8