#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int i, t;
  cin >> t;
  for (i = 0; i < t; i++) {
    int n;
    cin >> n;
    if (n % 4 != 0) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
      vector<int> a(n);
      int k = 2, l = 1, sum = 0, sumo = 0;
      for (int j = 0; j < n / 2; j++) {
        a[j] = k;
        k += 2;
        sum += a[j];
        if (j + n / 2 != n - 1) {
          a[j + n / 2] = l;
          l += 2;
          sumo += a[j + n / 2];
        } else {
          a[j + n / 2] = sum - sumo;
        }
      }
      for (int j = 0; j < n; j++) cout << a[j] << " ";
      cout << endl;
    }
  }
  return 0;
}
