#include<bits/stdc++.h>
#define int long long

using namespace std;

int n, d, k;

vector<pair<int, int>> e;

int t=1;
int sz, h;
stack<int> v, i;
void build(){
    v.push(t++);
    i.push(1);
    --sz;
    while(!v.empty()){
        if(i.top() == k){
            v.pop();
            i.pop();
            ++h;
            continue;
        }
        ++i.top();
        if(h > 0 && sz > 0){
            --h;
            e.push_back({v.top(), t});
            v.push(t++);
            i.push(1);
            --sz;
            continue;
        }
        i.pop();
        v.pop();
        ++h;
    }
}

main(){
    ios_base::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    cin >> n >> d >> k;
    if(k == 1){
        if(n == 1 && d == 0)
            cout << "YES\n";
        else if(n == 2 && d == 1)
            cout << "YES\n1 2\n";
        else cout << "NO\n";
        return 0;
    }
    if(n-1 < d){
        cout << "NO\n";
        return 0;
    }
    ++t;
    e.push_back({1, t});
    sz = n-d/2-1;
    h = (d+1)/2-1;
    build();
    sz += d/2;
    for(int i = 1; i < k; ++i){
        if(sz){
            e.push_back({1, t});
            h = d/2-1;
            build();
        }
    }
    if(sz) cout << "NO\n";
    else{
        cout << "YES\n";
        for(auto el : e)
            cout << el.first << ' ' << el.second << '\n';
    }
}

// 400000 79000 29
