#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(0);
  long long a, b;
  cin >> a;
  for (int i = 0; i < a; i++) {
    cin >> b;
    long long bruh = b / 2;
    if (bruh % 2 == 0) {
      long long num = 1;
      cout << "YES\n";
      for (int j = 1; j <= bruh; j++) cout << j * 2 << " ";
      for (int j = 1; j <= bruh / 2; j++) {
        cout << num << " ";
        num += 2;
      }
      for (int j = 1; j <= bruh / 2; j++) {
        num += 2;
        cout << num << " ";
      }
      cout << "\n";
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
