#include #include #include #include #include using namespace std; int N, maxH,seed; // utilizzo: ./generatore N maxH seed int main(int argc, char** argv) { assert(argc >= 2); N = atoi(argv[1]); // se N รจ 0 stampa il caso di prova if (N == 0) { cout << "8" << endl; cout << "6 6" << endl; cout << "8 5" << endl; cout << "7 3" << endl; cout << "3 7" << endl; cout << "4 6" << endl; cout << "2 2" << endl; cout << "5 9" << endl; cout << "1 1" << endl; return 0; } assert(argc == 4); maxH = atoi(argv[2]); seed = atoi(argv[3]); srand(seed); assert(0 < N && N <= 1000); assert(0 <= maxH && maxH <= 1000); cout << N << endl; for(int i = 0; i < N; ++i) cout << rand() % maxH+1 << " " << rand() % 50000 + 1 << endl; return 0; }