#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int tc;
  cin >> tc;
  while (tc--) {
    long long int n;
    cin >> n;
    if ((n / 2) % 2 == 0) {
      cout << "YES"
           << "\n";
      for (long long int i = 2; i <= n; i = i + 2) {
        cout << i << " ";
      }
      for (long long int i = 1; i < n - 1; i = i + 2) {
        cout << i << " ";
      }
      long long int p = n / 2;
      cout << n - 1 + (p * (p + 1)) - p * p << "\n";
    } else {
      cout << "NO"
           << "\n";
    }
  }
  return 0;
}
