func_code_string: #include <bits/stdc++.h>   using namespace std;   void err(istream_iterator<string> it) {}   template <typename T, typename... Args>   void err(istream_iterator<string> it, T a, Args... args) {     cerr <<  [   << *it <<   =   << a <<   ]  ;     err(++it, args...);   }   template <typename Tk, typename Tv>   ostream& operator<<(ostream& os, const pair<Tk, Tv>& p) {     os <<  {  << p.first <<  ,  << p.second <<  } ;     return os;   }   template <typename T>   ostream& operator<<(ostream& os, const vector<T>& p) {     os <<  [  ;     for (T x : p) os << x <<    ;     os <<  ]  <<   n ;     return os;   }   template <typename T>   ostream& operator<<(ostream& os, const set<T>& p) {     os <<  {  ;     for (T x : p) os << x <<    ;     os <<  }  <<   n ;     return os;   }   template <typename Tk, typename Tv>   ostream& operator<<(ostream& os, const map<Tk, Tv>& p) {     os <<  {  ;     for (pair<Tk, Tv> x : p) os << x <<    ;     os <<  }  <<   n ;     return os;   }   signed main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long int t = 1;     cin >> t;     while (t--) {       long long int n, k, l;       cin >> n >> k >> l;       vector<long long int> depth(n), time(2 * k);       for (long long int i = 0; i <= k; i++) {         time[i] = i;       }       long long int ct = 1;       for (long long int i = 0; i < n; i++) {         cin >> depth[i];       }       for (long long int i = k - 1; i > 0; i--) {         time[k + (ct++)] = i;       }       bool dp[2 * k][n];       memset(dp, false, sizeof(dp));       for (long long int i = 0; i < 2 * k; i++) {         if (depth[0] + time[i] <= l) {           dp[i][0] = true;         }       }       for (long long int i = 0; i < n - 1; i++) {         if (depth[i] + k <= l) {           if (i == 0) {             for (long long int j = 0; j < 2 * k; j++) {               dp[j][i] = true;             }           } else {             bool find_true = false;             for (long long int j = 0; j < 2 * k; j++) {               if (dp[j][i]) {                 find_true = true;               }             }             if (find_true) {               for (long long int j = 0; j < 2 * k; j++) {                 dp[j][i] = true;               }             }           }         }         for (long long int j = 0; j < 2 * k; j++) {           if (dp[j][i] &&               (depth[i + 1] + (long long int)time[(j + 1) % (2 * k)] <= l)) {             dp[(j + 1) % (2 * k)][i + 1] = true;           }         }       }       bool pass = false;       for (long long int i = 0; i < 2 * k; i++) {         if (dp[i][n - 1]) {           pass = true;           break;         }       }       cout << (pass ?  YES n  :  NO n );     }     return 0;   }   