#include <bits/stdc++.h>
int main() {
  int t;
  std::cin >> t;
  for (int i = 0; i < t; i++) {
    int n = 0;
    std::cin >> n;
    if (n % 4 == 0) {
      std::cout << "YES" << std::endl;
      for (int j = 2; j <= n; j += 2) {
        std::cout << j << " ";
      }
      for (int j = 1; j <= n; j += 2) {
        if (j + 2 > n) {
          std::cout << j + n / 2 << std::endl;
        } else
          std::cout << j << " ";
      }
    } else {
      std::cout << "NO" << std::endl;
    }
  }
}
