| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 64 MB | 118 | 61 | 24 | 35.821% |
You have got $n$ sticks of lengths $d_1, d_2, \ldots, d_n$. To build a ladder, you need $k+2$ sticks: two sticks of length $x$ and $k$ sticks of length $y$. You may shorten the sticks you already have, but you cannot divide one stick into two. Can you make a ladder?
The first line of the input contains a single integer $z,ドル the number of test cases. The descriptions of the test cases follow.
Each test case consists of four integers $n,ドル $k,ドル $x,ドル $y$ (1ドル \leq n \leq 10^5,ドル 0ドル \leq k \leq 10^5,ドル 1ドル \leq x, y \leq 10^9$) followed by $n$ integers $d_1,ドル $d_2,ドル $\ldots,ドル $d_n$ (1ドル \leq d_i \leq 10^9$).
For each test case, output a single line containing a single word "YES" if making a ladder is possible, or "NO" otherwise.
2 8 3 5 2 1 1 1 2 3 4 5 6 8 3 6 2 1 1 1 2 3 4 5 6
YES NO