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