#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if ((n / 2) % 2 == 1) {
      cout << "NO" << '\n';
      continue;
    }
    cout << "YES" << '\n';
    long long sumOdd = 0, sumEven = 0;
    for (int i = 2; i <= n; i += 2) {
      cout << i << " ";
      sumEven += i;
    }
    long long i = 1, temp = (n / 2) - 1;
    while (temp--) {
      cout << i << " ";
      sumOdd += i;
      i += 2;
    }
    cout << sumEven - sumOdd << '\n';
  }
  return 0;
}
