#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> sol;
int n, d, k, r;
int sub(int s, int d, int f) {
  int t{s};
  if (d == 0) return t;
  for (int i = 0; i < max(0, k - 2 * f); i++) {
    if (r == 0) break;
    sol.push_back({s, t + 1});
    r--;
    if (r == 0) {
      t++;
      break;
    }
    t = sub(t + 1, d - 1, 0);
  }
  return t;
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(nullptr);
  cin >> n >> d >> k;
  if (n < d + 1) {
    cout << "NO";
    return 0;
  }
  if (k == 1) {
    if (d > 1) {
      cout << "NO";
      return 0;
    }
    cout << "YES" << '\n' << 1 << ' ' << 2;
    return 0;
  }
  r = n - d - 1;
  int a{1}, b{2};
  for (int i = 0; i < d - 1; i++) {
    sol.push_back({a, b});
    a = b;
    b = sub(b, min(d - i - 1, i + 1), 1) + 1;
  }
  sol.push_back({a, b});
  if (b != n) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  for (auto [a, b] : sol) {
    cout << a << ' ' << b << '\n';
  }
}
