#include <bits/stdc++.h>
using namespace std;
const int N = 205;
int g[N];
int t;
int n, x;
int main()
{
cin >> t;
while (t--)
{
cin >> n >> x;
for (int i = 1; i <= n + n; i++) cin >> g[i];
sort(g + 1, g + n + n + 1);
int flag = 0;
for (int i = 1; i <= n; i++)
{
if (g[i + n] - g[i] < x)
{
flag = 1;
break;
}
}
if (flag == 1) cout << "NO" << endl;
else cout << "YES" << endl;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 200010;
LL g[N];
int t;
int n;
int main()
{
cin >> t;
while (t--)
{
LL res = 0;
cin >> n;
for (int i = 0; i < n; i++) cin >> g[i];
int i = 0;
while (g[i] == 0) i++;
for (int j = i; j < n - 1; j++)
{
if (g[j] == 0) res++;
else res += g[j];
}
cout << res << endl;
}
return 0;
}