#K93387. Taco Necklace
Taco Necklace
Taco Necklace
You are given n pearls with positive integer radii and an integer threshold k. Your task is to determine whether it is possible to choose two pearls (by rearranging the pearls arbitrarily) such that the sum of their radii is at least \(k\). In other words, check if there exists a pair \( (a,b) \) from the given list with \( a + b \ge k \).
Note: Since you can rearrange the pearls arbitrarily, it is sufficient to check whether the two largest pearls have a sum of at least \(k\). If \(n<2\), then the answer is "NO".
inputFormat
The first line of input contains an integer t representing the number of test cases. Each test case consists of two lines:
- The first line of each test case contains two integers n and k, where n is the number of pearls and k is the minimum required sum.
- The second line contains n integers, representing the radii of the pearls.
All input is read from standard input (stdin).
outputFormat
For each test case, output a single line containing either "YES" or "NO" (without quotes) on standard output (stdout). "YES" indicates that there exists a pair of pearls with a sum of radii at least \(k\), and "NO" otherwise.
## sample5
4 10
5 5 5 5
5 7
1 5 2 6 4
3 8
3 3 3
4 6
1 2 3 4
2 5
2 2
YES
YES
NO
YES
NO
</p>