#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n % 4 == 0) {
      cout << "YES" << endl;
      long long a = 2;
      long long sum1 = 0;
      for (int i = 1; i <= n / 2; i++) {
        cout << a << " ";
        sum1 += a;
        a += 2;
      }
      a = 1;
      long long sum2 = 0;
      for (int i = n / 2 + 1; i <= n; i++) {
        if (n != i) {
          cout << a << " ";
          sum2 += a;
          a += 2;
        } else {
          cout << sum1 - sum2 << " ";
        }
      }
      cout << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
