#include <bits/stdc++.h>
bool cmp(int i, int j) { return i < j; }
bool cmp2(int i, int j) { return i > j; }
using namespace std;
vector<pair<long long, long long> > fac_primos(long long N) {
  vector<pair<long long, long long> > v;
  for (long long i = 2; i * i <= N; i++) {
    long long a = 0;
    while (N % i == 0) {
      N = N / i;
      a++;
    }
    if (a) v.push_back(make_pair(i, a));
  }
  if (N > 1) v.push_back(make_pair(N, 1));
  return v;
}
vector<int> criba(int tam) {
  bool m[tam + 1];
  vector<int> v;
  m[0] = false;
  m[1] = false;
  for (int i = 2; i <= tam; ++i) m[i] = true;
  for (int i = 2; i * i <= tam; ++i) {
    if (m[i]) {
      for (int h = 2; i * h <= tam; ++h) m[i * h] = false;
    }
  }
  for (int i = 0; i <= tam; i++) {
    if (m[i]) v.push_back(i);
  }
  return v;
}
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
int main() {
  int n;
  int m;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m;
    if ((m / 2) % 2)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      for (int j = 1; j <= m / 2; j++) {
        if (j != 1) cout << " ";
        cout << 2 * j;
      }
      for (int j = 1; j < m / 2; j++) {
        cout << " " << 2 * j - 1;
      }
      cout << " " << m - 1 + m / 2 << endl;
    }
  }
  return 0;
}
