#include <bits/stdc++.h>
#include "testlib.h"
 
using namespace std;
#define all(x) x.begin(), x.end()
// const int SUMK = 100'000;
const long long MAXM = 200'000'000'000'000LL;
 
int main(int argc, char** argv) {
    registerGen(argc, argv, 1);
    int T =1000;
    println(T);
    // vector<int> nlist = rnd.partition(T, 200'000, 1);
    for (int i = 0; i < T; i++){
        int n = rnd.next(2, 20);
        vector<long long> b(n);
        int sumb = 0;
        for (int j = 0; j < n; j++) {
            b[j] = rnd.next(1, 20);
            sumb += b[j];
        }
        while (sumb < 3 * n) {
            sumb = 0;
            for (int j = 0; j < n; j++) {
                b[j] = rnd.next(1, 20);
                sumb += b[j];
            }
        }
        int a = rnd.next(1, 10);
        int M = rnd.next(3 * n * a, sumb * a * 2 + n - 1);
        println(n, a, M);
        println(b);
    }
    return 0;
}
