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.
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).
In the only line of the standard output write one integer: the number of postmen needed to deliver parcels to all clients.
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.
In the event of technical difficulties with Szkopuł, please contact us via email at [email protected].
If you would like to talk about tasks, solutions or technical problems, please visit our Discord servers. They are moderated by the community, but members of the support team are also active there.