#include <bits/stdc++.h>
using namespace std;
int t, n;
long long s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    if (n / 2 % 2 != 0) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
    s = 0;
    for (int i = 2; i <= n; i += 2) {
      cout << i << " ";
      s += i;
    }
    for (int i = 1; i <= n - 2; i += 2) {
      cout << i << " ";
      s -= i;
    }
    cout << s << "\n";
  }
  return 0;
}
