#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
vector<int> adj[400100];
int deep[400100];
int main() {
  int n, d, k;
  scanf("%d%d%d", &n, &d, &k);
  if (n <= d) {
    puts("NO");
    return 0;
  }
  if (n == 1) {
    puts("NO");
    return 0;
  }
  if (k == 1) {
    if (n == 2) {
      puts("YES");
      puts("1 2");
      return 0;
    }
    puts("NO");
    return 0;
  }
  for (int i = 1; i <= d; i++) {
    adj[i].push_back(i + 1);
  }
  for (int i = 1; i <= d + 1; i++) deep[i] = min(i - 1, d + 1 - i);
  for (int i = d + 2; i <= n; i++) deep[i] = 0x3f3f3f3f;
  int nn = d + 2;
  for (int i = 1; i <= n; i++) {
    if (nn > n) break;
    if (deep[i] == 0) continue;
    if (deep[i] == 0x3f3f3f3f) {
      puts("NO");
      return 0;
    }
    if (i <= d) {
      for (int j = 1; j <= k - 2; j++) {
        if (nn > n) break;
        deep[nn] = deep[i] - 1;
        adj[i].push_back(nn++);
      }
    } else {
      for (int j = 1; j < k; j++) {
        if (nn > n) break;
        deep[nn] = deep[i] - 1;
        adj[i].push_back(nn++);
      }
    }
  }
  puts("YES");
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < adj[i].size(); j++) {
      printf("%d %d\n", i, adj[i][j]);
    }
  return 0;
}
