#C511. Split Operation Feasibility

    ID: 48723 Type: Default 1000ms 256MiB

Split Operation Feasibility

Split Operation Feasibility

In this problem, you are given an array of integers and a threshold value (m). You are allowed to perform a split operation on any element; that is, you can split a number into two positive integers that sum up to the original number. The goal is to determine whether it is possible to obtain an array where every element is strictly less than (m) by applying the split operation as needed. It can be proven that if there exists at least one element in the original array that is already strictly less than (m), then it is always possible to split the remaining elements in such a way that all resulting numbers are less than (m). Otherwise, if every element in the array is greater than or equal to (m), then the answer is "NO".

For example, given the array [3, 9, 12, 15] and (m = 10), since (3 < 10) is present, you can adjust the other elements so that every number is less than 10, and the answer is "YES". Conversely, for the array [6, 6, 6] with (m = 5), no element is initially less than 5, hence the answer is "NO".

inputFormat

The input begins with an integer (T) representing the number of test cases. For each test case, the first line contains two integers (n) and (m), where (n) is the number of elements in the array ((1 \leq n \leq 10^5)) and (m) is the threshold ((1 \leq m \leq 10^9)). The second line of each test case contains (n) space-separated integers representing the array.

outputFormat

For each test case, output a single line containing "YES" if it is possible to transform the array so that all elements become strictly less than (m) using the allowed split operations, or "NO" otherwise.## sample

5
4 10
3 9 12 15
3 5
6 6 6
6 7
1 8 5 3 9 2
2 1
1 2
5 6
5 5 5 5 5
YES

NO YES NO YES

</p>