#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    if (n % 4 == 0) {
      cout << "YES\n";
      long long s = 0, s1 = 0;
      for (int i = 1; i <= n / 2; i++) {
        cout << 2 * i << " ";
        s = s + 2 * i;
      }
      for (int i = 1; i <= n / 2 - 1; i++) {
        cout << 2 * i - 1 << " ";
        s1 = s1 + 2 * i - 1;
      }
      cout << s - s1 << "\n";
    } else
      cout << "NO\n";
  }
  return 0;
}
