#include <bits/stdc++.h>
using namespace std;
int now;
vector<pair<int, int> > v;
int n, d, k;
bool dfs(int fa, int up, int lim) {
  if (!lim) return false;
  while (up--) {
    v.push_back(pair<int, int>(fa, ++now));
    if (now == n || dfs(now, k - 1, lim - 1)) return true;
  }
  return false;
}
int main() {
  scanf("%d%d%d", &n, &d, &k);
  if (k == 1 || n <= d) {
    printf("NO");
    return 0;
  }
  bool ok = false;
  now = d + 1;
  for (int i = 1; i <= d; ++i) v.push_back(pair<int, int>(i, i + 1));
  for (int i = 2; i <= d; ++i) {
    if (dfs(i, k - 2, min(i - 1, d + 1 - i))) {
      printf("YES\n");
      for (auto& i : v) printf("%d %d\n", i.first, i.second);
      return 0;
    }
  }
  printf("%d\n", now);
  printf("NO");
}
