import java.io.BufferedReader;
import java.io.IOError;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer stk = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(stk.nextToken());
        int d = Integer.parseInt(stk.nextToken());
        int k = Integer.parseInt(stk.nextToken());
        ArrayList<HashSet<Integer>> edge = new ArrayList<>();
        for(int i=0;i<=n;i++){
            edge.add(new HashSet<>());
        }
        if(k==1){
            if(d==n-1){
                StringBuilder sb = new StringBuilder();
                System.out.println("YES");
                for(int i=1;i<n;i++){
                    sb.append(i+" "+i+1).append('\n');
                }
                System.out.print(sb);
            }
            else{
                System.out.println("NO");
            }
        }
        else{
            if(n==1){
                if(d==0 && k == 1){
                    System.out.println("YES");
                    return;
                }
                else{
                    System.out.println("NO");
                    return;
                }
            }
            else if(n==2){
                if(d==1 && k==1){
                    System.out.println("YES");
                    System.out.println("1 2");
                    return;
                }
                else{
                    System.out.println("NO");
                    return;
                }
            }
            for(int i=1;i<n;i++){
                edge.get(i).add(i+1);
            }
            int dia = n-1;
            int now = n-1;
            int next = n-2;
            while(d< dia){
                int degree = 1;

                while(degree<=k && d<dia && next>=2){
                    edge.get(now).add(next);
                    edge.get(next).clear();
                    next--;
                    edge.get(next).remove(next+1);
                    edge.get(next).add(now);
                    degree++;
                    dia--;
                }
                now = next;
                next--;
                if(next==0){
                    System.out.println("NO");
                    return;
                }
            }
            if(d==dia){
                System.out.println("YES");
                int start = 1;
                Queue<Integer> q = new LinkedList<>();
                ((LinkedList<Integer>) q).add(start);
                StringBuilder sb = new StringBuilder();
                while(!q.isEmpty()){
                    int p = q.poll();
                    for(int s : edge.get(p)){
                        sb.append(p+" "+s).append('\n');
                        ((LinkedList<Integer>) q).add(s);
                    }
                }
                System.out.print(sb);
            }
            else{
                System.out.println("NO");
            }
        }
    }
}