#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long x = n / 2;
    if (x & 1) {
      cout << "NO"
           << "\n";
      continue;
    }
    long long sum = 0;
    vector<long long> ans;
    long long s = 2;
    for (long long i = 0; i < n / 2; i++) {
      ans.push_back(s);
      sum += s;
      s += 2;
    }
    s = 1;
    for (long long i = 0; i < n / 2 - 1; i++) {
      ans.push_back(s);
      sum -= s;
      s += 2;
    }
    ans.push_back(sum);
    cout << "YES"
         << "\n";
    for (long long i = 0; i < n; i++) cout << ans[i] << " ";
    cout << "\n";
  }
  return 0;
}
