#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const bool debugger1 = 0;
const bool debugger2 = 0;
const bool debugger3 = 0;
const bool debugger4 = 0;
const bool debugger5 = 0;
long long n, m, k, a, b, x, q, d;
vector<pair<int, int> > answer;
int main() {
  cin >> n >> d >> k;
  if (d == 1) {
    if (n >= 2) {
      cout << "NO";
      return 0;
    }
  }
  if (d == 2) {
    if (n - 1 > k) {
      cout << "NO";
      return 0;
    }
  }
  if (d >= n) {
    cout << "NO";
    return 0;
  }
  for (long long i = 1; i < d + 1; i++) answer.push_back(make_pair(i, i + 1));
  long long zostalo = n - (d + 1);
  zostalo += 2;
  long double sredni_stopien = (d + 1) / zostalo;
  int do_uzycia = d + 2;
  k--;
  if (sredni_stopien > k) {
    cout << "NO";
    return 0;
  } else {
    zostalo -= 2;
    for (int i = 2; i < d + 1; i++) {
      int licznik = 0;
      while (zostalo > 0 && licznik != k) {
        answer.push_back(make_pair(i, do_uzycia));
        do_uzycia++;
        licznik++;
        zostalo--;
      }
    }
    if (zostalo > 0) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES" << endl;
  for (long long i = 0; i < answer.size(); i++)
    cout << answer[i].first << " " << answer[i].second << endl;
  return 0;
}
