Tourist walks along the
X axis. He can choose either of two directions and any speed not exceeding
V. He can also stand without moving anywhere. He knows from newspapers that at time
t1 in the point with coordinate
x1 an interesting event will occur, at time
t2 in the point with coordinate
x2 − another one, and so on up to (
xn,tn). Interesting events are short so we can assume they are immediate. Event
i counts visited if at time
ti tourist was at point with coordinate
xi.
Write program tourist that will find maximum number of events tourist if:
- at the beginning (when time is equal to 0) tourist appears at point 0,
- tourist can choose initial point for himself.
Yes, you should answer on two similar but different questions.
Output
The only line of the output should contain two space-sepatated integers − maximum number of events tourist can visit in he starts moving from point 0 at time 0, and maximum number of events tourist can visit if he chooses the initial point for himself.