#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
int v[(1 << 20)];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  char end = '\n';
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n % 4) {
      cout << "NO\n";
      continue;
    }
    long long soma = 0;
    long long soma2 = 0;
    for (int i = 0; i < n / 2; i++) {
      v[i] = 2 * (i + 1);
      soma += 2 * (i + 1);
    }
    for (int i = n / 2; i < n; i++) {
      v[i] = 2 * (i - n / 2) + 1;
      soma2 += v[i];
    }
    soma -= soma2;
    v[n - 1] += soma;
    cout << "YES\n" << '\n';
    for (int i = 0; i < n; i++) {
      cout << v[i] << " ";
    }
    cout << '\n';
  }
  exit(0);
}
