#include <bits/stdc++.h>
using namespace std;
template <class _T>
inline void read(_T &_a) {
  bool f = 0;
  char _c = getchar();
  _a = 0;
  while (_c < '0' || _c > '9') {
    if (_c == '-') f = 1;
    _c = getchar();
  }
  while (_c >= '0' && _c <= '9') {
    _a = (_a << 3) + (_a << 1) - '0' + _c;
    _c = getchar();
  }
  if (f) _a = -_a;
}
int T, n, sum1, sum2;
int main() {
  for (read(T); T; --T) {
    read(n);
    sum1 = sum2 = 0;
    if ((n / 2) & 1) {
      printf("NO\n");
      continue;
    };
    printf("YES\n");
    for (register int i = 2; i <= n; i += 2) printf("%d ", i), sum1 += i;
    n >>= 1;
    for (register int i = 1; i < n; ++i)
      printf("%d ", 2 * i - 1), sum2 += 2 * i - 1;
    printf("%d\n", sum1 - sum2);
  }
  return 0;
}
