#include <bits/stdc++.h>
using namespace std;
int n, d, k, a[400007], b[400007], t[400007], p[400007];
int main() {
  scanf("%d%d%d", &n, &d, &k);
  if (k == 1) {
    printf("NO");
    return 0;
  }
  int u = 1, tmp = 0;
  queue<int> q;
  while (u <= d) {
    tmp++;
    a[tmp] = u;
    b[tmp] = u + 1;
    t[u] = max(u - 1, d - u + 1);
    p[u] = 2;
    if (t[u] < d) q.push(u);
    u++;
  }
  while (u < n && !q.empty()) {
    int v = q.front();
    q.pop();
    while (p[v] < k && u < n) {
      p[v]++;
      u++;
      tmp++;
      a[tmp] = v;
      b[tmp] = u;
      p[u] = 1;
      t[u] = t[v] + 1;
      if (t[u] < d) q.push(u);
    }
  }
  if (u == n) {
    printf("YES\n");
    for (int i = 1; i <= tmp; i++) printf("%d %d\n", a[i], b[i]);
  } else
    printf("NO");
  return 0;
}
