#include <bits/stdc++.h>
using namespace std;
const int N = 5e5;
const int M = 120;
vector<int> g[N];
int need[N];
int32_t main() {
  ios_base::sync_with_stdio(0);
  int n, d, k;
  cin >> n >> d >> k;
  int can = 0;
  set<int> all;
  d++;
  for (int i = 1; i <= ((d + 1) / 2); i++) {
    need[i] = can;
    need[d - i + 1] = can;
    can++;
  }
  for (int i = 1; i < d; i++) {
    g[i].push_back(i + 1);
    g[i + 1].push_back(i);
    if (g[i].size() > k) {
      cout << "NO" << '\n';
      return 0;
    }
    all.insert(i);
  }
  int cnt = d;
  int last = d + 1;
  while (cnt < n && all.size()) {
    auto it = *all.begin();
    int v = it;
    all.erase(it);
    while (cnt < n && g[v].size() < k && need[v] != 0) {
      g[v].push_back(last);
      g[last].push_back(v);
      need[last] = need[v] - 1;
      all.insert(last);
      last++;
      cnt++;
    }
  }
  if (cnt != n) {
    cout << "NO" << '\n';
    return 0;
  }
  cout << "YES" << '\n';
  for (int i = 1; i <= n; i++) {
    for (auto to : g[i]) {
      if (i < to) cout << i << ' ' << to << '\n';
    }
  }
  return 0;
}
