#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, k;
  cin >> n >> d >> k;
  int x = n;
  int cd = d;
  if (k == 1) {
    if (d > 1 || n > 2) {
      cout << "NO" << endl;
      exit(0);
    } else if (d == 1 && n == 2) {
      cout << "YES" << endl;
      cout << 1 << " " << 2 << endl;
      exit(0);
    }
  }
  if (d >= n) {
    cout << "NO" << endl;
    exit(0);
  }
  int dis[n + 1];
  memset(dis, -1, sizeof(dis));
  dis[1] = d;
  vector<int> gp[n + 1];
  int cur = 1;
  x--;
  while (d > 0) {
    gp[cur].push_back(cur + 1);
    gp[cur + 1].push_back(cur);
    dis[cur + 1] = max(cur, cd - cur);
    d--;
    x--;
    cur++;
  }
  cur++;
  for (int i = 1; i <= n; i++) {
    if (dis[i] == -1) continue;
    while (gp[i].size() < k && dis[i] + 1 <= cd && cur <= n) {
      gp[i].push_back(cur);
      gp[cur].push_back(i);
      dis[cur] = dis[i] + 1;
      cur++;
    }
  }
  if (cur <= n) {
    cout << "NO" << endl;
    exit(0);
  } else {
    bool vis[n + 1];
    memset(vis, 0, sizeof(vis));
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) {
      if (vis[i] == 0) {
        for (int j = 0; j < gp[i].size(); j++) {
          cout << i << " " << gp[i][j] << endl;
          vis[gp[i][j]] = 1;
        }
      }
    }
  }
  return 0;
}
