#include "validator.h"

void run() {
    const int MAX_N = toml<int>("MAXN");
    const int MAX_M = toml<int>("MAXM");
    const bool CONSECUTIVE = toml<bool>("CONSECUTIVE");
    const int MAX_WRITE = toml<int>("MAXWRITE");

    int m = Int(1, MAX_M);
    Space();
    int max_write = Int(1, 1000000000);
    Endl();
    int test_cases = Int(1, 100);
    Endl();

    if(MAX_WRITE != 1 && MAX_WRITE != max_write)
        die_line("maxwrite missmatch");

    int sum_n = 0;
    for (int tc = 0; tc < test_cases; tc++) {
        int n = Int(1, MAX_N);
        Endl();
        vector<int> ids = SpacedInts(n, 0, m-1);
        set<int> s(begin(ids), end(ids));
        if(s.size() != n)
            die_line("indices not unique");
        if(CONSECUTIVE && (*begin(s) != 0 || *prev(end(s)) != n-1))
            die_line("not consecutive");
        sum_n += n;
    }

    if(sum_n > 100)
        die_line("should be at most 100 procs / testcase");
}
