#include #include #include #include #include int main(int argc, char* argv[]) { if (argc != 3) { std::cerr << "Usage: " << argv[0] << " " << std::endl; return 1; } int n = std::stoi(argv[1]); int m = std::stoi(argv[2]); if (n < 1 || n > 1000000 || m < 1 || m > 1000000) { throw std::runtime_error("n and m must be between 1 and 10^6"); } std::random_device rd; std::mt19937 gen(rd()); std::cout << n << std::endl; // Generate n pairs of (x_i, y_i) std::uniform_real_distribution<> dis_xy(0.0, 10.0); for (int i = 0; i < n; ++i) { double x = dis_xy(gen); double y = dis_xy(gen); std::cout << std::fixed << std::setprecision(6) << x << " " << y << std::endl; } std::cout << m << std::endl; // Generate m sets of (L_j, R_j, lambda_j, X_j) std::uniform_real_distribution<> dis_lambda(0.0, 10.0); std::uniform_real_distribution<> dis_X(0.0, 10.0); for (int j = 0; j < m; ++j) { int L = std::uniform_int_distribution<>(1, n - 1)(gen); int R = std::uniform_int_distribution<>(L + 1, n)(gen); double lambda = dis_lambda(gen); double X = dis_X(gen); std::cout << L << " " << R << " " << std::fixed << std::setprecision(6) << lambda << " " << X << std::endl; } return 0; }