#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n % 4 != 0)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      int res1 = 0, res2 = 0;
      for (int i = 1; i <= n / 2; i++) {
        cout << i * 2 << " ";
        res1 += i * 2;
      }
      for (int i = 1; i <= n / 2 - 1; i++) {
        cout << i * 2 - 1 << " ";
        res2 += i * 2 - 1;
      }
      cout << res1 - res2 << endl;
    }
  }
  return 0;
}
