Convex Hull
Time limit1sMemory limit1024 MB
For each point, count how many of the other points lie on the convex hull after that point is removed from the set.
- Level
Hard8 of 10
- Topics
- Geometry, Sorting, Implementation
- Solved
- No attempts yet
Problem
The convex hull of a 2-dimensional point set is the polygon with the smallest perimeter that encloses all points in . It is called convex because the polygon always has a convex shape.
You are given a set of points. For each point , output the number of points in that lie exactly on the convex hull of . In other words, point is removed from before the hull is built. The hull can degenerate into a line segment or a single point, depending on the points.
Input
The first line contains an integer (), the number of points in . Each of the next lines contains two integers and (), the coordinates of the th point. No two points share the same coordinates.
Output
Print lines. The th line contains the number of points in that lie exactly on the convex hull of .