#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  fast();
  long long n, d, k;
  cin >> n >> d >> k;
  if (d >= n) {
    cout << "NO\n";
    return 0;
  }
  vector<long long> deg(n + 1, 0);
  vector<pair<long long, long long> > ans;
  for (long long i = 1; i <= d; i++) {
    deg[i]++;
    deg[i + 1]++;
    if (deg[i] > k or deg[i + 1] > k) {
      cout << "NO\n";
      return 0;
    }
    ans.push_back({i, i + 1});
  }
  set<pair<long long, long long> > q;
  for (long long i = 2; i <= d; i++) {
    q.insert({max(i - 1, d - (i - 1)), i});
  }
  for (long long i = d + 2; i <= n; i++) {
    while (!q.empty() and deg[q.begin()->second] == k) q.erase(q.begin());
    if (q.empty() or q.begin()->first == d + 1 or q.begin()->second == 1) {
      cout << "NO\n";
      return 0;
    }
    deg[i]++;
    deg[q.begin()->second]++;
    ans.push_back({i, q.begin()->second});
    q.insert({q.begin()->first + 1, i});
  }
  cout << "YES"
       << "\n";
  for (long long i = 0; i < ans.size(); i++)
    cout << ans[i].first << " " << ans[i].second << "\n";
  return 0;
}
