#include <bits/stdc++.h>
using namespace std;
const int MAXN = 400010;
int n, d, k;
int p[MAXN];
int prof[MAXN];
int degree[MAXN];
int maxProf[MAXN];
vector<pair<int, int> > edges;
queue<int> q;
void impossible() {
  printf("NO\n");
  exit(0);
}
void buildEdge(int U, int V) {
  degree[U]++;
  degree[V]++;
  edges.push_back({U, V});
}
int main() {
  scanf("%d %d %d", &n, &d, &k);
  if (n == 1) {
    if (d != 0) impossible();
    printf("YES\n");
    return 0;
  }
  if (n == 2) {
    if (d != 1) impossible();
    printf("YES\n");
    printf("1 2\n");
    return 0;
  }
  if (d >= n) impossible();
  int qtdNodes = d + 1;
  for (int i = 1; i <= d; i++) buildEdge(i, i + 1);
  for (int i = 1; i <= d + 1; i++) {
    p[i] = i;
    prof[i] = 0;
    maxProf[i] = min(i - 1, d + 1 - i);
    if (i == 1 || i == d + 1) continue;
    if (degree[i] > k) impossible();
    if (degree[i] < k) q.push(i);
  }
  while (!q.empty() && qtdNodes < n) {
    int cur = q.front();
    q.pop();
    buildEdge(cur, ++qtdNodes);
    p[qtdNodes] = p[cur];
    prof[qtdNodes] = prof[cur] + 1;
    if (degree[cur] < k) q.push(cur);
    if (prof[qtdNodes] == maxProf[p[cur]]) continue;
    if (degree[qtdNodes] < k) q.push(qtdNodes);
  }
  if (qtdNodes < n) impossible();
  printf("YES\n");
  for (int i = 0; i < edges.size(); i++)
    printf("%d %d\n", edges[i].first, edges[i].second);
}
