#include #include #include #include #include using namespace std; int main(int argc, char** argv) { // Optional SEED arg: default 42 long long SEED = (argc > 1 ? stoll(argv[1]) : 42); mt19937_64 rng(SEED); auto rnd = [&](int lo, int hi) { uniform_int_distribution d(lo, hi); return d(rng); }; // Max-stress parameters per problem limits const int R = 100; // max number of pints considered const int K = 300; // max number of pubs const int TMAX = 3600; // max drink time const int CMAX = 86400; // max closing const int WMAX = 86400; // max edge weight const size_t EDGE_CAP = 90000; // absolute cap per statement // 1) Drinking times: bias toward larger values to stress feasibility checks cout << R << "\n"; for (int i = 1; i <= R; ++i) { int ti = rnd(TMAX / 2, TMAX); // [1800..3600] if (ti < 1) ti = 1; cout << ti << (i == R ? '\n' : ' '); } // 2) Pubs and closing times: bias toward larger values cout << K << "\n"; for (int i = 1; i <= K; ++i) { int ci = rnd(CMAX / 2, CMAX); // [43200..86400] if (ci < 1) ci = 1; cout << ci << (i == K ? '\n' : ' '); } // 3) Edges: // First emit the full simple complete graph (K*(K-1)/2 = 44,850 for K=300). // Then add random duplicate edges (multi-edges) until we reach 90,000. vector> edges; edges.reserve(EDGE_CAP); for (int a = 1; a <= K; ++a) { for (int b = a + 1; b <= K; ++b) { int w = rnd(max(1, WMAX / 2), WMAX); edges.emplace_back(a, b, w); } } // Add duplicates to reach EDGE_CAP while (edges.size() < EDGE_CAP) { int a = rnd(1, K); int b = rnd(1, K); if (a == b) continue; if (a > b) swap(a, b); int w = rnd(1, WMAX); edges.emplace_back(a, b, w); } cout << edges.size() << "\n"; for (auto &e : edges) { int a, b, w; tie(a, b, w) = e; cout << a << " " << b << " " << w << "\n"; } return 0; }