---
# System prepended metadata

title: Sinh test cho may con chim

---

# Sinh test cho may con chim

```c++
#include <bits/stdc++.h>
using namespace std;

void chim(){
    system("gen > test.inp");
    system("sol < test.inp > sol.out");
    system("trau < test.inp > trau.out");

    if(system("fc sol.out trau.out") != 0){
        cout << " SAI!";
        exit(0);
    }else{
        cout << " DUNG!";
    }
}

signed main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    int T = 100;

    for(int i = 1; i <= T; i++){
        cout << "TEST " << i ;
        chim();
        cout << endl;
    }
}
```

Random ne~
```c++
mt19937 d(chrono::steady_clock::now().time_since_epoch().count());

//random tu l den r

int rand(int l, int r){
    return l + d() % (r - l + 1);
}
```