Your company, Byteland Express, has to deliver some parcels to clients
located somewhere in the city. The city consists of
south-north streets and west-east streets (both numbered
from 0 to ). A postman drives from one junction to a
neighbouring one in one minute. The company is located next to the junction of
streets number and .
All parcels have to be delivered as fast as possible, so driving to a
client located next to the junction of the -th and -th street, can
take at most (=exactly) minutes. It takes a very short
time to give a parcel to a client, so while driving to one client, a
postman can give a parcel to another client (but cannot choose a longer route
to do that). Your task is to determine how many postmen are needed to
perform the delivery.
Input
First line of input contains one integer (). Second line contains the location of the company, the following
lines contain locations of the clients. A description of a
location consists of two integers: coordinates and (). Every two points (from among company or clients)
differ on both coordinates (every is different and every is
different).
Output
In the only line of the standard output write one integer: the
number of postmen needed to deliver parcels to all clients.
Example
For the input data:
4
0 3
1 2
2 5
3 0
4 1
the correct result is:
3
Source contest of the task: CPSPC 2006.
Kontakt
W razie problemów technicznych ze Szkopułem, prosimy o kontakt mailowy pod adresem szkopul@fri.edu.pl.
Jeśli chciałbyś porozmawiać o zadaniach, rozwiązaniach lub problemach technicznych, odwiedź nasze serwery na Discordzie. Są one moderowane przez społeczność, ale członkowie zespołu wsparcia również aktywnie się tam udzielają.