#include <bits/stdc++.h>
#define SZ(v) ((int)(v).size())
using namespace std;

using ll = long long;

template<typename... Args>
void read(Args&... args)
{
	((cin >> args), ...);
}

template<typename... Args>
void write(Args... args)
{
	((cout << args << " "), ...);
}

template<typename... Args>
void writeln(Args... args)
{
	((cout << args << " "), ...); cout << '\n';
}

using T = double;
struct Line
{
	T a, b;

	T eval(pair<T, T> pt) {return a * pt.first + b;}

	Line compose(Line other) const
	{
		return {a * other.a, a * other.b + b};
	}
};

int main(void)
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	
	int nbPoints, valMax, nbBloques;
	read(nbPoints, valMax, nbBloques);
	vector<bool> blocked(nbPoints+1);
	while (nbBloques--)
	{
		int i;
		read(i);
		blocked[i] = true;
	}
	vector<Line> dp(nbPoints+1, {0, 0});
	dp[0] = {1, 0};
	dp[nbPoints] = {0,0};
	Line sum = {0, 0};
	for (int i(nbPoints-1); i > 0; --i)
	{
		int furthest = min(nbPoints, i + valMax+1);
		sum.a -= dp[furthest].a;
		sum.b -= dp[furthest].b;
		sum.a += dp[i+1].a;
		sum.b += dp[i+1].b;
		if (blocked[i]) dp[i] = {1, 0};
		else
		{
			dp[i].a += sum.a / valMax;
			dp[i].b += sum.b / valMax;
			dp[i].b++;
		}
	}
	Line eq({0, 0});
	for (int j(1); j <= valMax; ++j)
	{
		int nxt = min(nbPoints, j);
		eq = {eq.a + dp[nxt].a, eq.b + dp[nxt].b};
	}
	eq.a /= valMax;
	eq.b /= valMax;
	eq.b++;
	eq.a -= 1;
	if (abs(eq.a) < 1e-9)
		writeln(-1);
	else
		cout << setprecision(10) << fixed << -eq.b/eq.a << endl;
}

#include <bits/stdc++.h>
using namespace std;

#ifdef LOCAL
#include "/debug.h"
#else
#define db(...)
#endif

#define all(v) v.begin(), v.end()
#define pb push_back
using ll = long long;
const int NAX = 2e5 + 5, MOD = 1000000007;

vector<int> solveCase(int n, vector<int64_t> &a)
{
    // TODO: edit here
    db(n, a);
    vector<int> res;
    int idx = 1;
    for (size_t i = n; i >= 1;)
    {
        if (i == 3)
        {
            if (a[1] == 1 && a[2] == 2 && a[3] == 3)
                break;
            int id = -1;
            for (int j = 1; j + 1 <= i; j++)
                if ((j & 1) == (idx & 1))
                {
                    id = j;
                    break;
                }
            db(a, idx, id);
            swap(a[id], a[id + 1]);
            res.pb(id);
            db(idx, id, a);
            idx = (idx + 1) % 2;
            continue;
        }
        if (a[i] == i)
        {
            --i;
            continue;
        }
        int id = -1;
        for (int j = 1; j + 1 <= i; j++)
            if ((j & 1) == (idx & 1))
                if ((a[j] == i))
                {
                    id = j;
                    break;
                }
        db(i, id);
        if (id == -1)
        {
            for (int j = 1; j + 1 <= i; j++)
                if ((j & 1) == (idx & 1))
                {
                    id = j;
                    break;
                }
            if (id == -1)
            {
                cout << "WA\n";
                exit(0);
                assert(id != -1);
            }
        }
        swap(a[id], a[id + 1]);
        res.pb(id);
        db(idx, id, a);
        idx = (idx + 1) % 2;
    }
    db(a);
    db(res);
    return res;
}

// generated by oj-template v4.7.2 (https://github.com/online-judge-tools/template-generator)
int main()
{
#ifndef LOCAL
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
#endif
    constexpr char endl = '\n';
    // failed to analyze input format
    // TODO: edit here
    int t;
    cin >> t;
    for (size_t i = 0; i < t; i++)
    {
        int n;
        cin >> n;
        vector<int64_t> a(n + 1);
        for (int i = 1; i <= n; ++i)
        {
            cin >> a[i];
        }
        auto ans = solveCase(n, a);
        int M = ans.size();
        cout << M << endl;
        for (int i = 0; i < M; ++i)
        {
            cout << ans[i] << ' ';
        }
        cout << endl;
    }

    return 0;
}