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