Problem C
Subway Planning
Languages
en
ja
The government in a foreign country is looking into the possibility of establishing a subway system in its capital. Because of practical reasons, they would like each subway line to start at the central station and then go in a straight line in some angle as far as necessary. You have been hired to investigate whether such an approach is feasible. Given the coordinates of important places in the city as well as the maximum distance these places can be from a subway station (possibly the central station, which is already built), your job is to calculate the minimum number of subway lines needed. You may assume that any number of subway stations can be built along a subway line.
![\includegraphics[width=0.75\textwidth ]{subway}](/problems/subwayplanning/file/statement/en/img-0001.png)
Input
The first line in the input file contains an integer
Output
For each data set, output a single integer on a line by
itself: the minimum number of subway lines needed to make sure
all important places in the city are at a distance of at most
Sample Input 1 | Sample Output 1 |
---|---|
2 7 1 -1 -4 -3 1 -3 -1 2 3 2 4 2 -2 6 -2 4 0 0 4 -12 18 0 27 -34 51 |
4 2 |