#include "testlib.h" #include using namespace std; const int MIN_N = 0; const int MAX_N = 100; const int rnd_test_n = 100; template void append(vector &dest, const vector &orig) { dest.insert(dest.end(), orig.begin(), orig.end()); } string output_tc(string top, string bottom) { ostringstream oss; oss << top << endl << bottom << endl; return oss.str(); } vector generate_sample_tests() { vector tests; tests.push_back(output_tc("412", "503")); tests.push_back(output_tc("123", "540")); tests.push_back(output_tc("123", "405")); return tests; } vector generate_manual_tests() { vector tests; tests.push_back(output_tc("413", "025")); tests.push_back(output_tc("152", "403")); return tests; } string rnd_test(int i){ string start = "012345"; while (i-- && next_permutation(start.begin(), start.end())) {} return output_tc(start.substr(0, 3), start.substr(3)); } vector generate_random_tests() { vector tests; for (int i = 0; i < rnd_test_n; i++){ tests.push_back(rnd_test(i)); } return tests; } string extreme_test_1(){ return(output_tc("123", "450")); } vector generate_extreme_tests(){ vector tests; tests.push_back(extreme_test_1()); return tests; } int main(int argc, char *argv[]) { registerGen(argc, argv, 1); vector tests; size_t test = 0; append(tests, generate_sample_tests()); append(tests, generate_manual_tests()); append(tests, generate_random_tests()); append(tests, generate_extreme_tests()); for (const auto &t : tests) { startTest(++test); cout << t; } return 0; }