#include <bits/stdc++.h>
using namespace std;
const long long lim = 1e9 + 10;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long i, j, n, x;
    cin >> n;
    x = n / 2;
    if (x % 2 == 1) {
      cout << "NO\n";
      continue;
    }
    long long a[n / 2], asum, bsum, b[n / 2];
    asum = 0;
    bsum = 0;
    for (i = 1; i <= n / 2; ++i) {
      a[i - 1] = 2 * i;
      asum += a[i - 1];
    }
    for (i = 0; i < n / 2 - 1; ++i) {
      b[i] = (2 * i) + 1;
      bsum += b[i];
    }
    b[n / 2 - 1] = asum - bsum;
    cout << "YES\n";
    for (i = 0; i < n / 2; ++i) cout << a[i] << " ";
    for (i = 0; i < n / 2; ++i) cout << b[i] << " ";
    cout << endl;
  }
  return 0;
}
