#include <bits/stdc++.h>
using namespace std;
int n, d, k;
int tot = 1;
vector<pair<int, int> > v;
void digui(int dep, int limit, int now) {
  if (dep >= limit || tot == n) return;
  tot++;
  v.push_back(make_pair(now, tot));
  digui(dep + 1, limit, tot);
  if (tot == n) return;
  for (int i = 1; i < k - 1; i++) {
    tot++;
    v.push_back(make_pair(now, tot));
    digui(dep + 1, min(limit, dep + dep), tot);
    if (tot == n) return;
  }
}
int main() {
  cin >> n >> d >> k;
  if (n <= d) {
    puts("NO");
    return 0;
  }
  if (k == 1) {
    if (n == 1 && d == 0 || n == 2 && d == 1) {
      puts("YES");
      if (n == 2) puts("1 2");
    } else
      puts("NO");
    return 0;
  }
  n--;
  digui(1, d, 1);
  v.push_back(make_pair(1, n + 1));
  if (tot != n)
    puts("NO");
  else {
    puts("YES");
    for (auto i : v) cout << i.first << " " << i.second << endl;
  }
}
