#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    if (n % 4 != 0) {
      cout << "NO" << endl;
    } else {
      vector<long long int> a(n / 2);
      vector<long long int> b(n / 2);
      for (int i = 0; i < n / 4; i++) {
        a[i] = 2 * (i + 1);
        b[i] = 2 * (i + 1) - 1;
      }
      for (int i = n / 4; i < n / 2; i++) {
        a[i] = 2 * (i + 1);
        b[i] = 2 * (i + 1) + 1;
      }
      cout << "YES" << endl;
      for (auto c : a) {
        cout << c << ' ';
      }
      for (auto c : b) {
        cout << c << ' ';
      }
      cout << endl;
    }
  }
  return 0;
}
