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

const int MAXT = 10'000;
const int MAXN = 300'000;
const int MAXX = 1'000'000'000;
 
int main(int argc, char *argv[]) {
    registerValidation(argc, argv);
 
    int t = inf.readInt(1, MAXT, "t");
    inf.readEoln();
 
    int sum_n = 0;
    for (int test = 1; test <= t; test++) {
        setTestCase(test);
        int n = inf.readInt(1, MAXN, "n");
        sum_n += n;
        ensuref(sum_n <= MAXN, "n for all tests must not exceed 300000");
        inf.readSpace();
        inf.readInt(1, n, "k");
        inf.readEoln();
        inf.readInts(n, 1, MAXX, "x");
        inf.readEoln();
    }
    inf.readEof();
}
