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