#include <bits/stdc++.h>
using namespace std;
const int Maxn = 400005;
int n, d, k;
int p[Maxn], h[Maxn];
vector<int> v[Maxn];
int main() {
  scanf("%d%d%d", &n, &d, &k);
  if (n < d + 1) return (int)puts("NO") * 0;
  for (int i = 0; i < d; ++i) {
    v[i].push_back(i + 1);
    ++p[i];
    ++p[i + 1];
  }
  int cur = d + 1;
  queue<int> q;
  for (int i = 0; i <= d; ++i) {
    h[i] = min(i, d - i);
    if (h[i] > 0 && p[i] < k) q.push(i);
  }
  while (cur < n && !q.empty()) {
    int x = q.front();
    q.pop();
    while (cur < n && p[x] < k) {
      v[x].push_back(cur);
      ++p[x];
      ++p[cur];
      h[cur] = h[x] - 1;
      if (h[cur++]) q.push(cur - 1);
    }
  }
  if (cur < n) return (int)puts("NO") * 0;
  for (int i = 0; i < n; ++i)
    if (p[i] > k) return (int)puts("NO") * 0;
  puts("YES");
  for (int i = 0; i < n; ++i)
    for (auto x : v[i]) printf("%d %d\n", i + 1, x + 1);
  return 0;
}
