#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, k;
  cin >> n >> d >> k;
  int n_save = n;
  if (n != 2 && d == 1) {
    cout << "NO";
    return 0;
  }
  if (n == 2 && d == 1) {
    cout << "YES" << endl << "1 2";
    return 0;
  }
  if (k == 1 && n != 1) {
    cout << "NO";
    return 0;
  }
  if (k == 1) {
    cout << "YES";
    return 0;
  }
  if (n == 1) {
    cout << "NO";
    return 0;
  }
  string res = "";
  long long degre[n + d + 1];
  long long dista[n + d + 1];
  for (int i = 0; i < n + 1; ++i) {
    degre[i] = -1;
    dista[i] = -1;
  }
  n--;
  degre[1] = 0;
  for (int i = 1; i <= d; i++) {
    res += to_string(i) + " " + to_string(i + 1) + "\n";
    n--;
    degre[i]++;
    degre[i + 1] = 1;
    dista[i] = max(i - 1, d - i + 1);
  }
  dista[d + 1] = d;
  int i = d + 2;
  int j = 2;
  while (n && i < n_save + 1 && j < i) {
    if (degre[j] < k && dista[j] < d) {
      res += to_string(j) + " " + to_string(i) + "\n";
      degre[j]++;
      degre[i] = 1;
      dista[i] = 1 + dista[j];
      i++;
      n--;
    } else
      j++;
  }
  if (n)
    cout << "NO";
  else
    cout << "YES" << endl << res;
  return 0;
}
