import java.util.*;
import java.io.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        StringBuilder sb = new StringBuilder();
        int n = sc.nextInt();
        int d = sc.nextInt();
        int k = sc.nextInt();
        if(k == 1){
            pw.println(n == 1 && d == 0 ? "YES" : "NO");
        }else if(n == 1 || n <= d){
            pw.println("NO");
        }else{
            int v = 1;
            int edge = 0;
            for(int i = 1; i <= d; i++){
                sb.append(v).append(" ").append(v+1).append("\n");
                edge++;
                v++;
            }
            Deque<Integer> vq = new ArrayDeque<>();
            for(int i = v+1; i <= n; i++){
                vq.add(i);
            }
            Deque<Point> pq = new ArrayDeque<>();
            for(int i = 2; i <= d; i++){
                int dmax = Math.min(i-1,(d+1)-i);
                pq.add(new Point(i,0,2));
                while(pq.size() > 0 && vq.size() > 0){
                    Point p = pq.poll();
                    if(dmax <= p.pd){
                        continue;
                    }
                    for(int ii = p.pk; ii < k; ii++){
                        if(vq.size() <= 0){
                            break;
                        }
                        int next = vq.poll();
                        sb.append(p.i).append(" ").append(next).append("\n");
                        pq.add(new Point(next,p.pd+1,1));
                    }
                }
                if(vq.size() <= 0) break;
            }
            if(vq.size() <= 0){
                pw.println("YES");
                pw.println(sb.toString());
            }else{
                pw.println("NO");
                //pw.println(sb.toString());
            }
        }
        pw.flush();
    }

    static class GeekInteger {
        public static void save_sort(int[] array) {
            shuffle(array);
            Arrays.sort(array);
        }
 
        public static int[] shuffle(int[] array) {
            int n = array.length;
            Random random = new Random();
            for (int i = 0, j; i < n; i++) {
                j = i + random.nextInt(n - i);
                int randomElement = array[j];
                array[j] = array[i];
                array[i] = randomElement;
            }
            return array;
        }
 
    }
}

class Point{
    int i,pd,pk;
    public Point(int i, int d, int k){
        this.i = i;
        this.pd = d;
        this.pk = k;
    }
}

class Query implements Comparable<Query>{
    int i,v;
    public Query(int i, int v){
        this.i = i;
        this.v = v;
    }
    
    public int compareTo(Query q){
        if(this.v > q.v){
            return -1;
        }else if(this.v < q.v){
            return 1;
        }else{
            if(this.i < q.i){
                return -1;
            }else if(this.i > q.i){
                return 1;
            }else{
                return 0;
            }
        }
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
    }
    
    public String[] nextArray(int n) {
        String[] a = new String[n];
        for (int i = 0; i < n; i++)
            a[i] = next();
        return a;
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}
