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