#include <bits/stdc++.h>
using namespace std;
int t;
int n;
vector<int> answer;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie();
  cin >> t;
  for (; t > 0; --t) {
    cin >> n;
    if (n % 4 != 0) {
      cout << "NO"
           << "\n";
      continue;
    } else {
      answer.resize(n);
      for (int i = 0; i < n / 2; i++) {
        answer[i] = (i + 1) * 2;
        answer[i + n / 2] = (2 * i + 1);
      }
      answer[n - 1] += n / 2;
    }
    cout << "YES"
         << "\n";
    for (int i = 0; i < answer.size(); ++i) cout << answer[i] << " ";
    cout << "\n";
  }
  return 0;
}
