Logo
(追記) (追記ここまで)

34292번 - Orecart Boba Easy 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB63362350.000%

문제

The only difference between this version and the hard version is that in this version, the maximum speed $v$ is provided as input.

Eugin and Kelly are celebrating E-Days at the Colorado School of Mines by participating in the annual Orecart Pull. This is an event where everyone walks the Orecart down Colfax Avenue all the way to downtown Denver. Eugin and Kelly can go faster than the group, so they have decided to break off and grab boba from every stop along the route!

The walk is $l$ meters long, and the Orecart moves at a constant speed of 1ドル$ meter per second. Eugin and Kelly can run at a speed of at most $v$ meters per second, but they are not allowed to move ahead of the Orecart at any time.

There are $n$ boba stops along the route, the $i$-th of which is located at distance $d_i$ along the route. Additionally, at the $i$-th boba stop, they must wait at least $w_i$ seconds to receive their boba before continuing.

Eugin and Kelly need to visit all $n$ boba stops while ensuring that they reach the end at exactly the same time as the Orecart. Can they accomplish this?

입력

The input consists of multiple lines:

  • The first line contains two integers $n$ and $l$ $(1 \leq n \leq 10^5, 2 \leq l \leq 10^8)$---the number of boba stops and the length of the route.
  • The second line contains $n$ integers $d_1, d_2, \dots, d_n$ $(0 < d_1 < d_2 < \dots < d_n < l)$---the distances at which each of the boba stops are located.
  • The third line contains $n$ integers $w_1, w_2, \dots, w_n$ $(0 \leq w_i \leq 10^8)$---the waiting times at each boba stop.
  • The fourth line contains a single integer $v$ $(1 \leq v \leq 10^8)$---the maximum speed at which Eugin and Kelly can run.

출력

Print YES if it is possible for Eugin and Kelly to visit every boba stop and reach the end at exactly the same time as the Orecart. Otherwise, print NO.

제한

예제 입력 1

3 100
25 50 75
10 5 15
5

예제 출력 1

YES

예제 입력 2

4 100
20 40 60 80
10 23 13 15
6

예제 출력 2

NO

힌트

출처

School > CS@Mines > CS@Mines HSPC 2025 L번

  • 문제를 만든 사람: Kelly Dance
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /