#include <bits/stdc++.h>
using namespace std;
int main() {
  int turn, n;
  cin >> turn;
  for (int k = 0; k < turn; k++) {
    cin >> n;
    if (n % 4 != 0) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
      for (int i = 0; i < n / 4; i++) {
        cout << (i + 1) * 2 << " ";
      }
      for (int i = 0; i < n / 4; i++) {
        cout << (i + 1) * 2 + (n / 4 + 1) * 2 << " ";
      }
      for (int i = 0; i < n / 2; i++) {
        cout << i * 2 + 3 << " ";
      }
    }
  }
  return 0;
}
