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