#include <bits/stdc++.h>
using namespace std;
queue<int> cola;
queue<pair<int, int> > ans;
int n, d, k, depth[400005], lasto, nodo, degree[400005];
int main() {
  scanf("%d %d %d", &n, &d, &k);
  if (n <= d || (k < 2 && n > 2)) {
    printf("NO");
    return 0;
  }
  for (int i = 1; i <= d; i++) {
    degree[i] = 2;
    if (i + 1 == n) {
      printf("YES\n");
      while (!ans.empty())
        printf("%d %d\n", ans.front().first, ans.front().second), ans.pop();
      printf("%d %d\n", i, i + 1);
      return 0;
    }
    ans.push({i, i + 1});
    depth[i] = min(i - 1, d - i + 1);
    cola.push(i);
  }
  degree[1] = degree[d + 1] = 1;
  lasto = d + 1;
  while (!cola.empty()) {
    nodo = cola.front();
    cola.pop();
    if (depth[nodo] <= 0) continue;
    while (degree[nodo] < k) {
      degree[nodo]++;
      lasto++;
      ans.push({nodo, lasto});
      degree[lasto] = 1;
      depth[lasto] = depth[nodo] - 1;
      if (lasto == n) {
        printf("YES\n");
        while (!ans.empty())
          printf("%d %d\n", ans.front().first, ans.front().second), ans.pop();
        return 0;
      }
      cola.push(lasto);
    }
  }
  printf("NO\n");
  return 0;
}
