#include "validator.h"

void run() {
    int MAXN = toml<int>("MAXN");
    int MAXM = toml<int>("MAXM");
    int MINM = toml<int>("MINM");
    string MODE = toml<string>("MODE");
    int n = Int(1, MAXN);
    Space();
    int m = Int(MINM, min(n, MAXM));
    Endl();
    int sum = 0;
    vector <bool> hat (n, false);
    for (int i=0; i<m; i++){
        int L = Int(1, n);
        sum+=L;
        for (int j=0; j<L; j++){
            Space();
            int a = Int(0, n-1);
            if (hat[a]){
                die_line("Not a permutation - integers appear multiple times");
            }
            hat[a] = true;
        }
        Endl();
    }
    if (MODE == "all" && sum!=n) die_line("sum of L_i not equal to N");

    Eof();
    return;
}
