Problem: You are given an array a consisting of n integers.

In one move, you can choose some index i (1 ≤ i ≤ n - 2) and shift the segment [a_i, a_{i + 1}, a_{i + 2}] cyclically to the right (i.e. replace the segment [a_i, a_{i + 1}, a_{i + 2}] with [a_{i + 2}, a_i, a_{i + 1}]). 

Your task is to sort the initial array by no more than n^2 such operations or say that it is impossible to do that.

You have to answer t independent test cases.

Input

The first line of the input contains one integer t (1 ≤ t ≤ 100) — the number of test cases. Then t test cases follow.

The first line of the test case contains one integer n (3 ≤ n ≤ 500) — the length of a. The second line of the test case contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 500), where a_i is the i-th element a.

It is guaranteed that the sum of n does not exceed 500.

Output

For each test case, print the answer: -1 on the only line if it is impossible to sort the given array using operations described in the problem statement, or the number of operations ans on the first line and ans integers idx_1, idx_2, ..., idx_{ans} (1 ≤ idx_i ≤ n - 2), where idx_i is the index of left border of the segment for the i-th operation. You should print indices in order of performing operations.

Example

Input


5
5
1 2 3 4 5
5
5 4 3 2 1
8
8 4 5 2 3 6 7 3
7
5 2 1 6 4 7 3
6
1 2 3 3 6 4


Output


0

6
3 1 3 2 2 3 
13
2 1 1 6 4 2 4 3 3 4 4 6 6 
-1
4
3 3 4 4 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
const long long INF = (long long)1e9;
using namespace std;
long long power(long long x, long long y) {
  long long res = 1;
  x = x % 998244353;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = ((res % 998244353) * (x % 998244353)) % 998244353;
    y = y >> 1;
    x = ((x % 998244353) * (x % 998244353)) % 998244353;
  }
  return res;
}
vector<long long> pr;
void sieve(long long n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long i = 2; i <= n; i++)
    if (prime[i]) pr.push_back(i);
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long dp[1005][1005];
void reduce_to_zero() {
  long long range = 100, add = 0;
  long long x = 1;
  while (range) {
    add += min(range, x);
    x;
    range -= min(x, range);
  }
}
const long long N = 1e6 + 100;
long long fact[N], modulo = INF + 7;
long long binpow(long long val, long long deg, long long modi) {
  if (!deg) return 1 % modi;
  if (deg & 1) return binpow(val, deg - 1, 998244353) * val % modi;
  long long res = binpow(val, deg >> 1, modi);
  return (res * res) % modi;
}
void initfact() {
  fact[0] = 1;
  for (long long i = 1; i < N; i++) {
    fact[i] = (fact[i - 1] * i);
    fact[i] %= modulo;
  }
}
long long getC(long long n, long long i) {
  long long res = fact[n];
  long long div = fact[n - i] * fact[i];
  div %= modulo;
  div = binpow(div, modulo - 2, modulo);
  return (res * div) % modulo;
}
long long n, arr[505], arr2[505], tmp[505];
vector<long long> ans;
void shift(long long idx) {
  ans.push_back(idx);
  tmp[idx] = arr[idx + 2], tmp[idx + 1] = arr[idx], tmp[idx + 2] = arr[idx + 1];
  for (long long j = idx; j <= idx + 2; j++) arr[j] = tmp[j];
}
void we_have_choices() {
  ans.clear();
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> arr[i], arr2[i] = arr[i];
  sort(arr2 + 1, arr2 + 1 + n);
  for (long long i = 1; i <= n; i++) {
    long long idx = i;
    while (arr[idx] != arr2[i]) idx++;
    while (idx != i) {
      while (idx - 2 >= i) {
        idx -= 2;
        shift(idx);
      }
      if (idx == i + 1) {
        if (idx != n) {
          idx--;
          shift(idx);
          shift(idx);
        } else {
          if (arr[n - 2] == arr[n]) {
            shift(n - 2);
            break;
          }
          long long j;
          for (j = n - 2; j >= 1; j--) {
            if (arr[j] == arr[j + 1]) break;
          }
          if (!j) {
            cout << -1 << '\n';
            return;
          } else {
            for (long long k = j; k <= n - 2; k++) {
              shift(k);
              shift(k);
            }
          }
          idx = i;
        }
      }
    }
  }
  cout << ans.size() << '\n';
  for (auto i : ans) cout << i << " ";
  cout << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  ;
  long long t;
  cin >> t;
  while (t--) we_have_choices();
  return 0;
}