#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long a, sum1 = 0, sum2 = 0, b, c, d, e;
    cin >> a;
    if (a % 4 == 2)
      cout << "NO\n";
    else {
      cout << "YES\n";
      for (long long j = 1; j <= a / 2; ++j) {
        cout << 2 * j << " ";
        sum1 += 2 * j;
      }
      for (long long j = 1; j <= (a / 2) - 1; ++j) {
        cout << j * 2 - 1 << " ";
        sum2 += j * 2 - 1;
      }
      cout << sum1 - sum2 << "\n";
    }
  }
  return 0;
}
