#include <bits/stdc++.h>
using namespace std;
void deepshit() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  deepshit();
  long long n, d, k;
  cin >> n >> d >> k;
  if (n == 1) {
    if (d == 0 && k >= 0)
      cout << "YES";
    else
      cout << "NO";
  }
  if (n == 2) {
    if (d == 1 && k >= 1) {
      cout << "YES\n";
      cout << 1 << " " << 2;
    } else
      cout << "NO";
  }
  if (n == 3) {
    if (d == 2 && k >= 2) {
      cout << "YES\n";
      cout << 1 << " " << 2 << "\n";
      cout << 2 << " " << 3;
    } else
      cout << "NO";
  } else {
    if (d >= 2 && d <= n - 1) {
      vector<pair<long long, long long> > edges;
      long long t = 2;
      while (d--) {
        edges.push_back({t - 1, t});
        t++;
      }
      long long first = 2, last = t - 1;
      long long rem = n - t + 1;
      if ((rem + t - 4) / (t - 3) + 2 <= k) {
        cout << "YES\n";
        long long curr = first;
        while (t <= n) {
          edges.push_back({curr++, t++});
          if (curr == last + 1) curr = first;
        }
        for (long long i = 0; i < edges.size(); i++) {
          cout << edges[i].first << " " << edges[i].second << "\n";
        }
      } else {
        cout << "NO";
      }
    } else
      cout << "NO";
  }
  return 0;
}
