#include <bits/stdc++.h>
using namespace std;
int a[300000];
int main() {
  int t;
  cin >> t;
  int n;
  int i, j, k, l;
  while (t--) {
    cin >> n;
    int r = 2;
    int e = 1;
    if (n % 4)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      int x = n / 2;
      for (i = 0; i < x; i++) {
        a[i] = r;
        r = r + 2;
      }
      for (j = x; j < n - 1; j++) {
        a[j] = e;
        e = e + 2;
      }
      a[n - 1] = a[x - 1] + x - 1;
      for (i = 0; i < n; i++) {
        cout << a[i] << ' ';
      }
      cout << endl;
    }
  }
  return 0;
}
