CF1662L.Il Derby della Madonnina

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

The first line contains two integers nn and vv ( 1n21051 \le n \le 2 \cdot 10^5 , 1v1061 \le v \le 10^6 ) — the number of kicks that will take place and your maximum speed.

The second line contains nn integers t1,,tnt_1, \ldots, t_n ( 1ti1091 \le t_i \le 10^9 ) — the times of the kicks in the match. The sequence of times is guaranteed to be strictly increasing, i.e., t1<t2<<tnt_1 < t_2 < \cdots < t_n .

The third line contains nn integers a1,,ana_1, \ldots, a_n ( 109ai109-10^9 \le a_i \le 10^9 ) — the positions along the touch-line where you have to be to monitor closely each kick.

输入格式

Print the maximum number of kicks that you can monitor closely.

输出格式

In the first sample, it is possible to move to the right at maximum speed for the first 3.53.5 seconds and stay at position 77 until the first kick happens, and then immediately move right also at maximum speed to watch the second kick at position 1717 . There is no way to monitor closely the third kick after the second kick, so at most 22 kicks can be seen.

输入输出样例

  • 输入#1

    3 2
    5 10 15
    7 17 29

    输出#1

    2
  • 输入#2

    5 1
    5 7 8 11 13
    3 3 -2 -2 4

    输出#2

    3
  • 输入#3

    1 2
    3
    7

    输出#3

    0

说明/提示

In the first sample, it is possible to move to the right at maximum speed for the first 3.53.5 seconds and stay at position 77 until the first kick happens, and then immediately move right also at maximum speed to watch the second kick at position 1717 . There is no way to monitor closely the third kick after the second kick, so at most 22 kicks can be seen.

首页