#include <bits/stdc++.h>
long int distance[400001], degree[400001];
int main() {
  long int n, d, k, i, pos;
  scanf("%ld %ld %ld", &n, &d, &k);
  if (d >= n || ((d > 2) && (k == 1))) {
    printf("NO");
    return 0;
  }
  for (i = 1; i < d; i++) {
    distance[i] = i + 1;
    degree[i]++;
    degree[i + 1]++;
  }
  i++;
  pos = 1;
  while ((i <= n) && (pos <= d)) {
    if (degree[pos] < k) {
      if (pos + 1 > d) {
        printf("NO");
        return 0;
      }
      distance[i] = pos;
      degree[i]++;
      degree[pos]++;
      i++;
    } else
      pos++;
  }
  printf("YES\n");
  for (i = 1; i <= n; i++) {
    if (distance[i] != 0) printf("%ld %ld\n", i, distance[i]);
  }
  return 0;
}
