#include <bits/stdc++.h>
using namespace std;
const int NMAX = 2 * 1e5 + 2;
int t, n, valeurs[NMAX];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> t;
  for (int test = 1; test <= t; test++) {
    cin >> n;
    if (n % 4 != 0) {
      cout << "NO\n";
    } else {
      int moitie = n / 2, somme = 0, cur = 0;
      for (int i = 0; i < moitie; i++) {
        valeurs[i] = 2 * (i + 1);
        somme += valeurs[i];
      }
      for (int i = 0; i < moitie - 1; i++) {
        valeurs[i + moitie] = 2 * i + 1;
        cur += valeurs[i + moitie];
      }
      valeurs[n - 1] = somme - cur;
      cout << "YES\n";
      for (int i = 0; i < n; i++) cout << valeurs[i] << ' ';
      cout << '\n';
    }
  }
}
