#include <bits/stdc++.h>
using namespace std;
int T, n;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> T;
  while (T--) {
    cin >> n;
    if (((n / 2) % 2)) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
    int sp = 0, sd = 0;
    for (int i = 1; i <= n / 2; i++) {
      cout << i * 2 << " ";
      sp += i * 2;
    }
    for (int i = 0; i < n / 2 - 1; i++) {
      cout << i * 2 + 1 << " ";
      sd += i * 2 + 1;
    }
    cout << sp - sd << "\n";
  }
}
