#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  if ((n / 2) & 1) {
    puts("NO");
    return;
  }
  vector<int> a(n);
  puts("YES");
  a[0] = 2;
  a[n / 2] = 1;
  for (int i = 1; i < n / 2; i++) {
    if (i + 1 == n / 2) {
      a[i + n / 2] = a[i - 1] + n / 2 + 1;
      a[i] = a[i - 1] + 2;
    } else {
      a[i + n / 2] = a[i + n / 2 - 1] + 2;
      a[i] = a[i - 1] + 2;
    }
  }
  for (int x : a) {
    cout << x << ' ';
  }
  cout << '\n';
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
