#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, n, i, j, s, sum, x, s2;
  while (scanf("%lld", &t) == 1) {
    for (i = 1; i <= t; i++) {
      scanf("%lld", &n);
      x = n / 2;
      if (x % 2 == 0) {
        s = 0;
        sum = 1;
        s2 = 1;
        printf("YES\n");
        for (j = 1; j < n; j++) {
          if (j <= n / 2) {
            printf("%lld ", 2 * j);
            s = s + 2 * j;
          } else if (j == (n / 2 + 1))
            printf("1 ");
          else {
            printf("%lld ", sum + 2);
            sum += 2;
            s2 += sum;
          }
        }
        printf("%lld\n", s - s2);
      } else
        printf("NO\n");
    }
  }
  return 0;
}
