#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int j1 = 0; j1 < t; j1++) {
    long long int n;
    cin >> n;
    long long int arr[n];
    long long int sum1 = 0;
    long long int sum2 = 0;
    for (int j = 0; j < (n / 2); j++) {
      arr[j] = ((2 * j) + 2);
      sum1 += arr[j];
    }
    long long int p = 1;
    for (int k = n / 2; k < n - 1; k++) {
      arr[k] = (2 * p - 1);
      p++;
      sum2 += (arr[k]);
    }
    arr[n - 1] = sum1 - sum2;
    if (n % 4 == 0) {
      cout << "YES" << endl;
      for (int m = 0; m < n; m++) {
        cout << arr[m] << " ";
      }
      cout << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
