|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||13||4||4||44.444%|
John Doe wants to transport his possessions from one bank of Lake Michigan to the other. His possessions consist of W wolves, S sheep, and C cabbages. The transportation will be carried out using a boat that can hold up to K of these items at the same time. During each step, John can take some items from one bank and transfer them to the other bank. Unfortunately, when left unsupervised, wolves will eat sheep and sheep will eat cabbages (but wolves don’t eat cabbages). John doesn’t want to lose his possessions, so he has to devise a scheme such that this doesn’t happen. With John present, any combination of items is allowed (both on the bank and in the boat). This is also true during the loading process. Since John isn’t very good at solving problems like this, he asks you to help him.
Input contains a single line with four integers: W, S, C, K. The input satisfies the following constraints:
If it’s possible to perform the transportation without the loss of items, print YES, otherwise print NO.
1 1 1 1
2 2 0 1