#include <bits/stdc++.h>
using namespace std;
vector<int> g[400010];
int deg[400010], cur = 0;
void build(int n, int max_dist, int dist, int last, int max_deg) {
  if (dist >= max_dist || cur > last) return;
  while (deg[n] != max_deg && cur <= last) {
    g[n].push_back(cur);
    deg[n]++;
    deg[cur]++;
    cur++;
    build(cur - 1, max_dist, dist + 1, last, max_deg);
  }
}
int main() {
  ios::sync_with_stdio(0);
  int n, d, k;
  cin >> n >> d >> k;
  if (n == 1) {
    if (d != 0)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  } else if (n == 2) {
    if (d != 1)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      cout << "1 2" << endl;
    }
  } else {
    if (k == 1)
      cout << "NO" << endl;
    else if (d + 1 > n)
      cout << "NO" << endl;
    else {
      for (int i = 1; i <= d; i++) {
        g[i].push_back(i + 1);
        deg[i]++;
        deg[i + 1]++;
      }
      cur = d + 2;
      for (int i = 2; i <= d && cur <= n; i++)
        build(i, min(i - 1, d + 1 - i), 0, n, k);
      if (cur <= n) {
        cout << "NO" << endl;
        return 0;
      }
      cout << "YES" << endl;
      for (int i = 1; i <= n; i++) {
        for (int j = 0; j < g[i].size(); j++)
          cout << i << ' ' << g[i][j] << endl;
      }
    }
  }
  return 0;
}
