#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  int n;
  cin >> t;
  while (t--) {
    cin >> n;
    if ((n / 2) % 2 == 1) {
      cout << "NO"
           << "\n";
    } else {
      cout << "YES"
           << "\n";
      for (int k = 1; k <= n / 2; k++) {
        cout << 2 * k << " ";
      }
      for (int i = 1; i < n / 2; i++) {
        cout << (2 * i - 1) << " ";
      }
      cout << ((n / 2 * (n / 2 + 1)) - ((n / 2 - 1) * (n / 2 - 1))) << "\n";
    }
  }
  return 0;
}
