#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int ans = 0, mark = 1;
  int t = getchar();
  while (t < '0' || t > '9') {
    if (t == '-') mark = -1;
    t = getchar();
  }
  while (t <= '9' && t >= '0') {
    ans = (ans << 3) + (ans << 1) + t - '0';
    t = getchar();
  }
  return ans * mark;
}
const int INF = 0x3f3f3f3f;
const int N = 1e6 + 5, p = 1e9 + 7;
void init() { return; }
void solve() {
  int(n) = read();
  n /= 2;
  if (n & 1)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  if (!(n & 1)) {
    for (int i = 1; i <= n; i++) cout << 2 * i << ' ';
    for (int i = 1; i <= n / 2; i++) cout << 2 * i - 1 << ' ';
    for (int i = 1; i <= n / 2; i++) cout << 2 * (i + n / 2) + 1 << ' ';
    cout << endl;
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  init();
  int(Loop_var) = read();
  while (Loop_var--) solve();
  return 0;
}
