#include #include #include #include #include #include #define TESTING using namespace std; bool a[105][105]; int main() { #ifdef TESTING freopen("grafc.in", "r", stdin); freopen("grafc.out", "w", stdout); #endif ios_base::sync_with_stdio(false); cin.tie(0); int k, m, n; cin >> k >> m >> n; if (n != 1 && m != 1) { cout << -1; return 0; } int op = 0; if (n == 1) swap(n, m), op = 1; if (k <= 3 && k > 1 && n == 1) { cout << -1; return 0; } vector< pair > sol; for (int i = 1; i <= k - n; ++i) sol.push_back(make_pair(i, i + 1)); if (op == 0) { for (auto& it : sol) a[it.first][it.second] = 1; sol.clear(); for (int i = 1; i <= k; ++i) for (int j = i + 1; j <= k; ++j) if (!a[i][j]) sol.push_back(make_pair(i, j)); } cout << sol.size() << '\n'; for (auto& it : sol) cout << it.first << ' ' << it.second << '\n'; return 0; } //Trust me, I'm the Doctor!