#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj(400001);
int a[400001];
int main() {
  int n, d, k;
  scanf("%d%d%d", &n, &d, &k);
  if (d >= n || (k == 1 && n != 2)) {
    printf("NO\n");
    return 0;
  }
  for (int i = 1; i <= d; ++i) {
    adj[i].push_back(i + 1);
    adj[i + 1].push_back(i);
  }
  for (int i = 1; i <= d + 1; ++i) {
    a[i] = max(i - 1, d - i + 1);
  }
  for (int j = d + 2, i = 1; j <= n; ++j) {
    for (; i <= n && (i == j || adj[i].size() == k || a[i] == d); ++i)
      ;
    if (i > n) {
      printf("NO\n");
      return 0;
    }
    adj[i].push_back(j);
    adj[j].push_back(i);
    a[j] = 1 + a[i];
  }
  printf("YES\n");
  for (int i = 1; i <= n; ++i) {
    for (auto j : adj[i]) {
      if (j <= i) {
        continue;
      }
      printf("%d %d\n", i, j);
    }
  }
  return 0;
}
