CF76F.Tourist

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Tourist walks along the XX axis. He can choose either of two directions and any speed not exceeding VV . He can also stand without moving anywhere. He knows from newspapers that at time t1t_{1} in the point with coordinate x1x_{1} an interesting event will occur, at time t2t_{2} in the point with coordinate x2x_{2} — another one, and so on up to ( xn,tnx_{n},t_{n} ). Interesting events are short so we can assume they are immediate. Event ii counts visited if at time tit_{i} tourist was at point with coordinate xix_{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.

输入格式

The first line of input contains single integer number NN ( 1<=N<=1000001<=N<=100000 ) — number of interesting events. The following NN lines contain two integers xix_{i} and tit_{i} — coordinate and time of the ii -th event. The last line of the input contains integer VV — maximum speed of the tourist. All xix_{i} will be within range 2108<=xi<=2108-2·10^{8}<=x_{i}<=2·10^{8} , all tit_{i} will be between 11 and 21062·10^{6} inclusive. VV 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.

输出格式

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.

输入输出样例

  • 输入#1

    3
    -1 1
    42 7
    40 8
    2
    

    输出#1

    1 2
    
首页