#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
template <class T>
ostream& operator<<(ostream& os, vector<T> v) {
  cout << "[";
  for (auto& i : v) cout << i << ", ";
  cout << "]"
       << "\n";
  return os;
}
template <typename K, typename V>
ostream& operator<<(ostream& os, pair<K, V> p) {
  os << "{" << p.first << ", " << p.second << "} ";
  return os;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n % 4) {
      cout << "NO"
           << "\n";
      continue;
    }
    cout << "YES"
         << "\n";
    int ans = 0;
    for (int i = 1; i <= n / 2; ++i) {
      cout << i * 2 << " ";
      ans += i * 2;
    }
    for (int i = 1; i < n / 2; ++i) {
      cout << i * 2 - 1 << " ";
      ans -= i * 2 - 1;
    }
    cout << ans << "\n";
  }
  return 0;
}
