#include <bits/stdc++.h>
using namespace std;
struct Edge {
  long long u, v, w;
  Edge(long long u = 0, long long v = 0, long long w = 0) : u(u), v(v), w(w) {}
  bool operator<(Edge a) { return w < a.w; }
};
const long long M = 4e5 + 7;
const long long MOD = 1e9 + 7;
const long long MAX = 1e9 + 9;
inline long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long power(long long n, long long k, long long p = MOD) {
  long long r = 1;
  for (; k; k >>= 1LL) {
    if (k & 1LL) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
long long inverse(long long n, long long p = MOD) { return power(n, p - 2); }
int n, d, k;
int bac[M], nx, e[M];
vector<pair<int, int> > ans;
int cn;
void dfs(int u, int p, int maxbac) {
  bac[u] = bac[p] + 1;
  if (bac[u] >= maxbac) return;
  if (cn >= nx) return;
  while (e[u] < k && cn < nx) {
    e[u]++;
    e[++cn]++;
    ans.push_back(pair<int, int>(u, cn));
    dfs(cn, u, maxbac);
  }
}
void solve() {
  cin >> n >> d >> k;
  bac[0] = -1;
  if (d % 2) {
    e[1]++;
    e[2]++;
    ans.push_back(pair<int, int>(1, 2));
    cn = 2;
    nx = n - d / 2;
    dfs(1, 0, d / 2);
    nx = n;
    dfs(2, 0, d / 2);
    if (cn != n) {
      cout << "NO";
      return;
    }
    cout << "YES\n";
    for (auto x : ans) cout << x.first << " " << x.second << endl;
  } else {
    e[1]++;
    e[2]++;
    ans.push_back(pair<int, int>(1, 2));
    cn = 2;
    nx = n - d / 2;
    dfs(1, 0, d / 2 - 1);
    nx = n;
    dfs(2, 0, d / 2);
    if (cn != n) {
      cout << "NO";
      return;
    }
    cout << "YES\n";
    for (auto x : ans) cout << x.first << " " << x.second << endl;
  }
}
int main() {
  ios::sync_with_stdio(0);
  solve();
  return 0;
}
