#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n % 2 == 0) {
      if (n % 4 == 0) {
        cout << "YES" << endl;
        int sum1 = 0, sum2 = 0;
        vector<int> v;
        for (int i = 2; i <= n; i += 2) {
          v.push_back(i);
          sum1 += i;
        }
        for (int i = 1; i <= n; i += 2) {
          v.push_back(i);
          sum2 += i;
        }
        int x = (sum1 - sum2);
        int y = v.back();
        v.back() = x + y;
        for (int i = 0; i < n; i++) {
          cout << v[i] << " ";
        }
        cout << endl;
      } else
        cout << "NO" << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
