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