2020-11-14 14:15:30 +00:00
|
|
|
#include <bits/stdc++.h>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
int t;
|
|
|
|
cin >> t;
|
|
|
|
while (t--) {
|
2021-11-19 09:01:13 +00:00
|
|
|
int n, x, a[55], b[55];
|
2020-11-14 14:15:30 +00:00
|
|
|
bool flag = false;
|
|
|
|
cin >> n >> x;
|
|
|
|
for (int i = 0; i < n; i++) {
|
|
|
|
cin >> a[i];
|
|
|
|
}
|
|
|
|
for (int i = 0; i < n; i++) {
|
|
|
|
cin >> b[i];
|
|
|
|
}
|
|
|
|
sort(a, a + n);
|
|
|
|
sort(b, b + n);
|
|
|
|
reverse(b, b + n);
|
|
|
|
for (int i = 0; i < n; i++) {
|
|
|
|
if (a[i] + b[i] > x) {
|
|
|
|
flag = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (flag) {
|
|
|
|
cout << "No" << endl;
|
2021-11-19 09:01:13 +00:00
|
|
|
} else {
|
2020-11-14 14:15:30 +00:00
|
|
|
cout << "Yes" << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|