#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";
    } else {
      cout << "YES\n";
      int sum1 = 0, sum2 = 0;
      for (int i = 2; i / 2 <= n / 2; i += 2) {
        cout << i << ' ';
        sum1 += i;
      }
      for (int i = 1; i / 2 < n / 2 - 1; i += 2) {
        cout << i << ' ';
        sum2 += i;
      }
      cout << sum1 - sum2 << '\n';
    }
  }
  return 0;
}
