#include <bits/stdc++.h>
using namespace std;
void dikhao(int x, int &current, int k, int n) {
  if (x) {
    int a = current;
    current++;
    if (current > n) return;
    x--;
    for (int i = 0; i < k - 1; i++) {
      cout << a << " " << current << endl;
      if (x) {
        dikhao(x, current, k, n);
      }
      current++;
      if (current > n) return;
    }
  }
}
int main() {
  int n, d, k;
  cin >> n >> d >> k;
  if (n <= d || n < k) {
    cout << "NO";
    return 0;
  }
  if (n == 1) {
    if (d == 0 && k == 0) {
      cout << "YES" << endl << 1;
    } else {
      cout << "NO";
    }
    return 0;
  }
  if (n == 2) {
    if (d != 1 || k != 1) {
      cout << "NO";
    } else {
      cout << "YES" << endl << 1 << " " << 2;
    }
    return 0;
  }
  int flag = 0;
  long long x = d - 2;
  long long num = k;
  while (x > 1) {
    num = num + num * (k - 1);
    if (num + 1 >= n) {
      flag = 1;
      break;
    }
  }
  if (x == 1) {
    num += k - 1;
    if (num + 1 >= n) flag = 1;
  }
  if (flag) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
    return 0;
  }
  int current = 1;
  for (int i = 0; i < d; i++) {
    current++;
    if (current > n) return 0;
    cout << i + 1 << " " << i + 2 << endl;
  }
  current++;
  if (current > n) return 0;
  for (int i = 2; i <= d; i++) {
    int x = min((i - 1), (d + 1 - i));
    cout << i << " " << current << endl;
    x--;
    if (x) {
      dikhao(x, current, k, n);
    } else
      current++;
    if (current > n) return 0;
  }
}
