#include <bits/stdc++.h>
using namespace std;
const int SEED = chrono::steady_clock::now().time_since_epoch().count();
mt19937 rng(SEED);
void test_case() {
  int n;
  cin >> n;
  bool ok = true;
  vector<int> v(n);
  for (auto &x : v) cin >> x;
  for (int i = 0; i < n; i += 2)
    if (v[i] % 2 == 0) ok = false;
  if (ok) {
    vector<int> op;
    for (int i = n; i > 1; i -= 2) {
      int a, b;
      auto getPos = [&](int x) {
        for (int j = 0; j < n; j++)
          if (v[j] == x) return j;
        return -1;
      };
      a = getPos(i);
      if (a != 0) {
        op.push_back(a);
        reverse(v.begin(), v.begin() + a + 1);
      }
      b = getPos(i - 1);
      op.push_back(b - 1);
      reverse(v.begin(), v.begin() + b);
      op.push_back(b + 1);
      reverse(v.begin(), v.begin() + b + 2);
      op.push_back(2);
      reverse(v.begin(), v.begin() + 3);
      op.push_back(i - 1);
      reverse(v.begin(), v.begin() + i);
    }
    cout << op.size() << endl;
    for (auto x : op) cout << x + 1 << " ";
    cout << endl;
  } else
    cout << -1 << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    test_case();
  }
  return 0;
}
