Requiescat in Pace
시간 제한1초메모리 제한1024 MB
직선으로 주어진 도로와 후보 지점들이 있을 때, 가장 가까운 도로까지의 거리가 최대인 후보 지점을 고른다.
문제
After P-22’s passing, there was significant discussion about what should happen to his remains. Initially, there was talk of storing them in the Natural History Museum (across from USC), but in the end, it was decided that a native tribe would give him a ritualistic burial at an undisclosed location in the Santa Monica Mountains. Of course, we do not know exactly how they chose the location, but probably, they first collected a few candidate locations, and then picked the best one according to one or more criteria. A natural criterion would be for the location to be far from all roads and hiking trails, so that the burial site would be less likely to be disturbed, and because P-22, while alive, also mostly avoided proximity to humans. Here, you will choose such a candidate location.
You will be given all the trails/roads as straight line segments — curved roads could of course be approximated by a sequence of such segments. You will also be given the candidate burial locations. You are to select the candidate location that maximizes the minimum distance to any point on any trail/road.
입력
The first line is the number of input data sets, followed by the data sets, each of the following form:
The first line of the data set contains two integers , the number of trails and the number of candidate locations. This is followed by lines, each containing two floating point , , the location of the -th candidate burial site. Next are T lines, each containing four floating point numbers , , , . This means that the -th trail/road goes from the point to along a straight line. All coordinates will be between and .
출력
For each data set, output “Data Set :” on a line by itself, where is its number.
Then, output the index of the burial site that is as far as possible from its closest point on a trail. Our inputs will be such that there will never be any ties, or any near-ties (whose distance to the respective closest trail differs by less than ).
Each data set should be followed by a blank line.