Great Treaty of Byteland
InterviewTime limit0.5sMemory limit1024 MB
Given capital coordinates on a plane, list the kingdoms whose Voronoi cells are unbounded, which are the capitals on the convex hull boundary.
Problem
The Great War of Byteland is over. The remaining kingdoms are now discussing the Division Treaty, which will split all the land in the world among them. The treaty covers not only the known world but also any territory yet to be discovered or inhabited, including land and sea. Assume the world is an infinite flat plane.
Each kingdom in Byteland has a single capital. The treaty assigns each point of the world to the kingdom whose capital is nearest in a straight line. If a point is equally close to two or more capitals, it lies on the border between their kingdoms. Some kingdoms may end up enclosed by others, while others may get unlimited territory. Some monarchs contest the treaty and ask for help. Given the coordinates of each capital, find the kingdoms that would have infinite territories under the treaty.
Input
The first line contains a single integer (), the number of kingdoms. Each kingdom is identified by a unique integer from 1 to . Each of the next lines contains two integers and (), the coordinates of a kingdom's capital. The capitals are given in increasing order of kingdom identifier, no two capitals share a location, and every capital has negligible size.
Output
Print a single line with the identifiers of the kingdoms that have infinite territories, in increasing order, separated by spaces. At least one such kingdom is guaranteed to exist.