#include #include using namespace std; void generate (int n); /** * ./sbGenerator N * Generate a graph with N nodes 2N-3 edges, N badge IDs that requires * most nodes to be visited at least twice * to resolve the badge ID propogation. * * Answer will be N-3 */ int main (int argc, char** argv) { int N = atoi(argv[1]); generate(N); return 0; } void generate (int N) { int L = N + N - 3; int B = N; cout << N << ' ' << L << ' ' << B << endl; cout << 0 << ' ' << N-1 << endl; for (int i = 1; i <= N-2; ++i) cout << 0 << ' ' << i << ' ' << i << ' ' << i << endl; cout << (N-2) << ' ' << 1 << ' ' << 0 << ' ' << B-1 << endl; for (int i = 1; i < N-2; ++i) cout << i << ' ' << i+1 << ' ' << 0 << ' ' << B-1 << endl; cout << 2 << ' ' << N-1 << ' ' << 2 << ' ' << B-1 << endl; }