#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 1;
int n, d, k, dist[N], deg[N];
vector<pair<int, int> > ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> d >> k;
  if (d >= n) {
    cout << "NO" << '\n';
    return 0;
  }
  for (int i = 1; i <= d; i++) {
    ans.push_back({i, i + 1});
    deg[i]++;
    deg[i + 1]++;
  }
  queue<int> qu;
  int it = d + 2, u;
  for (int i = 1; i <= d + 1; i++) {
    dist[i] = (d % 2 == 0) ? abs(1 + d / 2 - i)
                           : min(abs(1 + d / 2 - i), abs(2 + d / 2 - i));
    qu.push(i);
  }
  while (!qu.empty() && it <= n) {
    u = qu.front();
    qu.pop();
    if (dist[u] == d / 2) continue;
    while (deg[u] < k && it <= n) {
      dist[it] = dist[u] + 1;
      ans.push_back({u, it});
      deg[it] = 1;
      deg[u]++;
      qu.push(it);
      it++;
    }
  }
  bool ok = 1;
  for (int i = 1; i <= n; i++) {
    if (deg[i] > k) ok = 0;
  }
  if (it <= n || !ok)
    cout << "NO" << '\n';
  else {
    cout << "YES" << '\n';
    for (int i = 0; i < ans.size(); i++) {
      cout << ans[i].first << " " << ans[i].second << '\n';
    }
  }
}
