//package com.company;

import java.io.*;
import java.util.*;

public class Main {

    static long TimeStart;
    public static void main(String[] args) throws IOException {
        TimeStart = System.currentTimeMillis();
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        Task t = new Task();
        t.solve(sc, pw);
        pw.close();
    }

    public static class Task{

        public void solve(Scanner sc, PrintWriter pw) throws IOException {
            int n = sc.nextInt();
            int d = sc.nextInt();
            int k = sc.nextInt();
            int ft = k;
            List<Integer>[] edges = new List[n];
            for (int i = 0; i < n; i++) {
                edges[i] = new ArrayList<>();
            }
            List<Integer> indexInLevel = new ArrayList<>();
            indexInLevel.add(0);
            int startIndex = 1;
            int index_processed = 0;
            int height = 0;
            outer:
            while (true) {
                List<Integer> indexNextLv = new ArrayList<>();
                for (int indexToProcess : indexInLevel) {
                    for (int i = 0; i < k; i++) {
                        if (startIndex >= n) {
                            break outer;
                        }
                        edges[indexToProcess].add(startIndex);
                        indexNextLv.add(startIndex++);
                        index_processed++;
                    }
                    if (k == ft) k--;
                }
                indexInLevel = indexNextLv;
                index_processed = 0;
                height++;
            }
            int def_height = height * 2;
            if (index_processed != 0) def_height++;
            if (def_height > d) {
                pw.println("NO");
            } else {
                pw.println("YES");
                for (int i = 0; i < n; i++) {
                    for (int t : edges[i])
                        pw.println((i + 1) + " " + (t + 1));
                }
            }
        }

    }

    public static class Scanner {
        StringTokenizer st;
        BufferedReader br;
        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }
        public String next() throws IOException {
            while (st == null || ! st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }
        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }
        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
    }
}
