#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int MAXN = 4e5 + 5;
int deg[MAXN];
vector<pair<int, int> > edges;
int main() {
  ios::sync_with_stdio(0);
  int n, d, k;
  cin >> n >> d >> k;
  if (k == 1) {
    if (d == 1 && n == 2) {
      cout << "YES" << endl;
      cout << 1 << ' ' << 2 << endl;
    } else {
      cout << "NO" << endl;
    }
  } else {
    if (d == 1) {
      if (n == 2) {
        cout << "YES" << endl;
        cout << 1 << ' ' << 2 << endl;
      } else {
        cout << "NO" << endl;
      }
    } else {
      if (d >= n) {
        cout << "NO";
      } else {
        int now = 2;
        int od = d;
        int prev = 1;
        while (d--) {
          edges.push_back(make_pair(prev, now));
          deg[prev]++;
          deg[now]++;
          prev = now++;
        }
        if (now > n) {
          cout << "YES" << endl;
          for (auto p : edges) {
            cout << p.first << ' ' << p.second << endl;
          }
        } else {
          int fst = 1, lst = now - 1;
          set<pair<int, int> > ms;
          for (int i = 2; i < lst; ++i) {
            int d1 = abs(i - 1);
            int d2 = abs(i - lst);
            if (deg[i] < k) ms.insert(make_pair(max(d1, d2), i));
          }
          while (now <= n) {
            if (ms.empty()) {
              cout << "NO";
              return 0;
            }
            pair<int, int> f = *ms.begin();
            ms.erase(ms.begin());
            if (f.first + 1 > od) {
              cout << "NO";
              return 0;
            }
            while (deg[f.second] < k && now <= n) {
              edges.push_back(make_pair(f.second, now));
              ms.insert(make_pair(f.first + 1, now));
              deg[f.second]++;
              deg[now++]++;
            }
          }
          cout << "YES" << endl;
          for (auto p : edges) {
            cout << p.first << ' ' << p.second << endl;
          }
        }
      }
    }
  }
  return 0;
}
