#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, odd = 1, even = 2;
    cin >> n;
    if ((n / 2) % 2 != 0)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      int c = n / 2, sum = 0;
      while (c--) {
        sum += even;
        cout << even << " ";
        even += 2;
      }
      c = n / 2 - 1;
      while (c--) {
        sum -= odd;
        cout << odd << " ";
        odd += 2;
      }
      cout << sum << endl;
    }
  }
  return 0;
}
