func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     long long int t;     cin >> t;     while (t--) {       long long int n;       cin >> n;       long long int idx[2 * n + 1], chk = 2 * n;       vector<long long int> coin;       coin.push_back(0LL);       for (long long int i = 1; i <= 2 * n; i++) {         long long int x;         cin >> x;         idx[x] = i;       }       for (long long int i = 2 * n; i >= 1; i--) {         if (idx[i] <= chk) {           coin.push_back(chk - idx[i] + 1);           chk = idx[i] - 1;         }       }       long long int cost = n, coin_no = coin.size() - 1;       long long int dp[coin_no + 1][cost + 1];       memset(dp, 0, sizeof(dp));       for (long long int i = 0; i <= coin_no; i++) dp[i][0] = 1;       for (long long int i = 1; i <= coin_no; i++) {         for (long long int j = 1; j <= cost; j++) {           dp[i][j] = dp[i - 1][j];           if (coin[i] <= j) dp[i][j] |= dp[i - 1][j - coin[i]];         }       }       if (dp[coin_no][cost])         cout <<  YES  << endl;       else         cout <<  NO  << endl;     }     return 0;   }   