In the event of technical difficulties with Szkopuł, please contact us via email at szkopul@fri.edu.pl.
If you are familiar with IRC chat, the support team is also reachable on PIRC network (irc.pirc.pl
) in #szkopul
channel. If you are not, just use email.
Please do not ask us things like "how to solve task XYZ?".
Please remember that the support team has to sleep sometimes or go to work in real life.
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.