#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long sum = 0, N;
  cin >> N;
  if (((N / 2) & 1)) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  for (long long i = 1; i <= N / 2; i++) {
    cout << 2LL * i << " ";
    sum += 2LL * i;
  }
  for (long long i = 1; i <= N / 2; i++) {
    if (i != N / 2) {
      cout << 2LL * i - 1LL << " ";
      sum -= 2LL * i - 1LL;
    } else {
      cout << sum << "\n";
    }
  }
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  long long T;
  cin >> T;
  while (T--) solve();
  return 0;
}
