#include "testlib.h"

using namespace std;

int main(int argc, char *argv[]) {
    registerValidation(argc, argv);

    int t = inf.readInt(1, 10'000, "t");
    inf.readEoln();
    int cnt_n = 0;
    for (int i = 1; i <= t; i++) {
        setTestCase(i);
        int n = inf.readInt(1, 200'000, "n");
        cnt_n += n;
        inf.readSpace();
        int k = inf.readInt(1, 1000'000'000, "k");
        inf.readEoln();
        inf.readInts(n, 1, 1000'000'000, "a");
        inf.readEoln();
    }
    ensuref(cnt_n <= 200'000, "n is too big");
    inf.readEof();
    return 0;
}