func_code_string: #include <bits/stdc++.h>   using namespace std;   int a[500005];   int q[500005];   int n, k, d;   int main() {     scanf( %d%d%d , &n, &k, &d);     for (int i = 1; i <= n; i++) scanf( %d , &a[i]);     sort(a + 1, a + n + 1);     int l = 1, r = 1;     q[l] = 0;     for (int i = k; i <= n; i++) {       while (l <= r && a[i] - a[q[l] + 1] > d) l++;       if (l <= r && i - q[l] >= k) q[++r] = i;     }     if (q[r] == n)       printf( YES n );     else       printf( NO n );     return 0;   }   