#include <iostream>
#include <fstream>
#include <string>
#include <chrono>
#include <random>
#include <ctime>
#include <cstdlib>
using namespace std;
#define ll long long
const string NAME1 = "sol";
const string NAME2 = "sol_alt";
const ll MAXab = 1000000000;
const int T = 200;
int n, S, temp;
ll rg(ll l, ll r) {
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
return uniform_int_distribution<ll>(l, r)(rng);
}
int main() {
for (int i = 1; i <= T; ++i) {
ofstream inp("g_test.inp");
ll a = rg(100000000, MAXab);
ll b = rg(100000000, MAXab);
inp << a << " " << b;
inp.close();
system(("./" + NAME1).c_str());
system(("./" + NAME2).c_str());
if (system(("colordiff " + NAME1 + ".out " + NAME2 + ".out").c_str()) != 0) {
cout << "Test " << i << ": WA!\n";
return 0;
}
cout << "Test " << i << ": AC!\n";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPiAKI2luY2x1ZGUgPGZzdHJlYW0+CiNpbmNsdWRlIDxzdHJpbmc+CiNpbmNsdWRlIDxjaHJvbm8+CiNpbmNsdWRlIDxyYW5kb20+CiNpbmNsdWRlIDxjdGltZT4KI2luY2x1ZGUgPGNzdGRsaWI+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIGxsIGxvbmcgbG9uZwpjb25zdCBzdHJpbmcgTkFNRTEgPSAic29sIjsgCmNvbnN0IHN0cmluZyBOQU1FMiA9ICJzb2xfYWx0IjsgCmNvbnN0IGxsIE1BWGFiID0gMTAwMDAwMDAwMDsKY29uc3QgaW50IFQgPSAyMDA7IAppbnQgbiwgUywgdGVtcDsgCgpsbCByZyhsbCBsLCBsbCByKSB7CgltdDE5OTM3IHJuZyhjaHJvbm86OmhpZ2hfcmVzb2x1dGlvbl9jbG9jazo6bm93KCkudGltZV9zaW5jZV9lcG9jaCgpLmNvdW50KCkpOyAKCXJldHVybiB1bmlmb3JtX2ludF9kaXN0cmlidXRpb248bGw+KGwsIHIpKHJuZyk7IAp9CgppbnQgbWFpbigpIHsKCWZv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