Problem A
Hurricane Danger!
Hurricanes can cause a lot of destruction when they pass over land. Given the path that a hurricane takes and the locations of a number of cities, find which city is in the most danger of damage. That is, the city that is closest to the path the hurricane takes. Assume that each hurricane travels in a straight line, and that it has been traveling for a long time and will continue to do so for a long time.
Input
The first line of input contains an integer
Output
For each set of cities, print the name of the city that is in the greatest danger. If more than one city is considered in greatest danger, print them all separated by spaces in the order they appear in the input.
Sample Input 1 | Sample Output 1 |
---|---|
2 1 1 2 1 3 Waco 5 3 Lafayette 5 2 Knoxville 7 4 3 3 10 10 3 Tampa 5 5 Rochester 12 12 Duluth 15 16 |
Lafayette Tampa Rochester |