#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n % 4 != 0) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
    int d = 2, x = 2;
    for (int i = 1; i <= n / 2; i++) {
      cout << x << " ";
      x += d;
      (d == 2) ? d = 4 : d = 2;
    }
    d = 4;
    x = 1;
    for (int i = 1; i <= n / 2; i++) {
      cout << x << " ";
      x += d;
      (d == 2) ? d = 4 : d = 2;
    }
    cout << "\n";
  }
  return 0;
}
