#include <bits/stdc++.h>
using namespace std;
long long q;
long long sum(long long a, long long n, long long d) {
  return (a + a + d * (n - 1)) * n / 2;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(40);
  cin >> q;
  while (q--) {
    long long n;
    cin >> n;
    if (n % 4) {
      cout << "NO\n";
      continue;
    }
    n >>= 1;
    cout << "YES\n";
    for (long long i = 1; i < n; ++i) cout << i * 2 << ' ';
    cout << sum(3, n, 2) - sum(2, n - 1, 2) << ' ';
    for (long long i = 0; i < n; ++i) cout << 3 + i * 2 << ' ';
    cout << '\n';
  }
}
