aboutsummaryrefslogtreecommitdiff
path: root/codeforces/MarkThePhotographer
diff options
context:
space:
mode:
Diffstat (limited to 'codeforces/MarkThePhotographer')
-rwxr-xr-xcodeforces/MarkThePhotographer/mainbin0 -> 44912 bytes
-rw-r--r--codeforces/MarkThePhotographer/main.cpp31
-rw-r--r--codeforces/MarkThePhotographer/main_input0.txt7
-rw-r--r--codeforces/MarkThePhotographer/main_output0.txt3
4 files changed, 41 insertions, 0 deletions
diff --git a/codeforces/MarkThePhotographer/main b/codeforces/MarkThePhotographer/main
new file mode 100755
index 0000000..eaaf214
--- /dev/null
+++ b/codeforces/MarkThePhotographer/main
Binary files differ
diff --git a/codeforces/MarkThePhotographer/main.cpp b/codeforces/MarkThePhotographer/main.cpp
new file mode 100644
index 0000000..15c4e29
--- /dev/null
+++ b/codeforces/MarkThePhotographer/main.cpp
@@ -0,0 +1,31 @@
+#include <bits/stdc++.h>
+
+using namespace std;
+
+int main() {
+ ios_base::sync_with_stdio(false);
+ cin.tie(NULL);
+ int tt;
+ cin >> tt;
+ while (tt--) {
+ int n, y;
+ cin >> n >> y;
+ vector<int> v(2 * n);
+ int ans = 0;
+ for (int &x : v)
+ cin >> x;
+ sort(v.begin(), v.end());
+ for (int i = 0; i < n; i++) {
+ int x = v[i];
+ int z = v[i + n];
+ if (z - x >= y) {
+ ans++;
+ }
+ }
+ if (ans == n) {
+ cout << "YES" << '\n';
+ } else {
+ cout << "NO" << '\n';
+ }
+ }
+}
diff --git a/codeforces/MarkThePhotographer/main_input0.txt b/codeforces/MarkThePhotographer/main_input0.txt
new file mode 100644
index 0000000..3e55cb5
--- /dev/null
+++ b/codeforces/MarkThePhotographer/main_input0.txt
@@ -0,0 +1,7 @@
+3
+3 6
+1 3 9 10 12 16
+3 1
+2 5 2 2 2 5
+1 2
+8 6
diff --git a/codeforces/MarkThePhotographer/main_output0.txt b/codeforces/MarkThePhotographer/main_output0.txt
new file mode 100644
index 0000000..0db7433
--- /dev/null
+++ b/codeforces/MarkThePhotographer/main_output0.txt
@@ -0,0 +1,3 @@
+YES
+NO
+YES