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