#include <bits/stdc++.h>
using namespace std;
long long n = 1009;
int LG2(int N) {
  int ans = 0;
  while (N) {
    N >>= 1;
    ans++;
  }
  return ans - 1;
}
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  int n, d, k;
  cin >> n >> d >> k;
  if (k == 1) {
    if (n == 1) {
      if (d == 0)
        cout << "YES";
      else
        cout << "NO";
      return 0;
    }
    if (n == 2) {
      if (d == 1)
        cout << "YES\n1 2";
      else
        cout << "NO";
      return 0;
    }
    cout << "NO";
    return 0;
  }
  if (n == 1) {
    if (d == 0)
      cout << "YES";
    else
      cout << "NO";
    return 0;
  }
  if (n == 2) {
    if (d == 1) {
      if (k >= 1) {
        cout << "YES\n1 2";
        return 0;
      } else
        cout << "NO";
    }
    cout << "NO";
    return 0;
  }
  if (d >= n) {
    cout << "NO";
    return 0;
  }
  vector<pair<long long, long long> > ans;
  vector<long long> fr(n + 9);
  vector<long long> dis(n + 9);
  set<pair<long long, long long> > S;
  for (int i = 1; i <= d; i++) {
    ans.push_back({i, i + 1});
    fr[i]++;
    fr[i + 1]++;
    dis[i] = min(abs(i - 1), abs(d + 1 - i));
    if (fr[i] < k) S.insert({dis[i], i});
  }
  dis[d + 1] = 0;
  stack<int> st;
  for (int i = d + 2; i <= n; i++) {
    st.push(i);
  }
  while (st.size()) {
    int u = st.top();
    st.pop();
    if (!S.size()) {
      cout << "NO";
      return 0;
    }
    auto it = S.end();
    it--;
    pair<long long, long long> p = *it;
    S.erase(it);
    if (p.first) {
      fr[p.second]++;
      ans.push_back({p.second, u});
      if (fr[p.second] < k) S.insert(p);
      fr[u]++;
      S.insert({p.first - 1, u});
    } else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < (ans.size()); i++) {
    cout << ans[i].first << " " << ans[i].second << '\n';
  }
  return 0;
}
