#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int caso = 0; caso < t; caso++) {
    int n;
    cin >> n;
    vector<int> arr(n);
    if (n % 4 != 0) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
    for (int i = 1; i <= n / 2; i++) {
      cout << 2 * i << " ";
    }
    for (int i = 1; i <= n / 2; i++) {
      cout << 2 * (i - 1) + 1 + (i == n / 2 ? n / 2 : 0) << " ";
    }
    cout << endl;
  }
  return 0;
}
