#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, d, arr[400005];
  cin >> n >> k >> d;
  if (k * d <= n) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  memset(arr, 0, sizeof(arr));
  int cnt = n - 1;
  for (int i = 1; i <= n;) {
    int j = i + 1;
    int len = min(i - 1, abs(k - i)) + 1;
    int ii = i;
    while (arr[i] < d) {
      int l = len;
      while (l) {
        cout << ii << " " << j << endl;
        arr[ii]++;
        arr[j]++;
        ii++;
        j++;
        l--;
        cnt--;
        if (cnt == 0) {
          return 0;
        }
      }
      ii = i;
    }
    i = j - 1;
  }
  return 0;
}
