Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

binary search

data structures

dp

*2300

No tag edit access

The problem statement has recently been changed. View the changes.

×
F. Tourist

time limit per test

0.5 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputTourist 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 *t*_{1} in the point with coordinate *x*_{1} an interesting event will occur, at time *t*_{2} in the point with coordinate *x*_{2} — another one, and so on up to (*x*_{n}, *t*_{n}). Interesting events are short so we can assume they are immediate. Event *i* counts visited if at time *t*_{i} tourist was at point with coordinate *x*_{i}.

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.

Input

The first line of input contains single integer number *N* (1 ≤ *N* ≤ 100000) — number of interesting events. The following *N* lines contain two integers *x*_{i} and *t*_{i} — coordinate and time of the *i*-th event. The last line of the input contains integer *V* — maximum speed of the tourist. All *x*_{i} will be within range - 2·10^{8} ≤ *x*_{i} ≤ 2·10^{8}, all *t*_{i} will be between 1 and 2·10^{6} inclusive. *V* will be positive and will not exceed 1000. The input may contain events that happen at the same time or in the same place but not in the same place at the same time.

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.

Examples

Input

3

-1 1

42 7

40 8

2

Output

1 2

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jun/14/2024 06:44:59 (k1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|