#include <bits/stdc++.h>
using namespace std;
const int BIG = 1e5 + 9;
const int INF = 1e9 + 9;
const long long BINF = 1e18 + 9;
const double SML = (1e-7);
long long t, n, i, sum1, sum2;
bool check() {
  int num = n / 2;
  if (num % 2 == 0) {
    return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    sum1 = sum2 = 0;
    bool go = check();
    if (!go) {
      cout << "NO\n";
    } else {
      cout << "YES\n";
      vector<int> ans;
      for (int i = 1, j = 2; i <= n / 2; i++, j = j + 2) {
        sum1 = sum1 + j;
        ans.push_back(j);
      }
      for (int i = 1, j = 1; i < n / 2; i++, j = j + 2) {
        sum2 = sum2 + j;
        ans.push_back(j);
      }
      ans.push_back(sum1 - sum2);
      for (i = 0; i < ans.size(); i++) {
        cout << ans[i] << ' ';
      }
      cout << "\n";
    }
  }
  return 0;
}
