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

public class Main {
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 32768);
    static PrintWriter out = new PrintWriter(System.out);
    static StringTokenizer t;

    static String sn() {
        while (t == null || !t.hasMoreTokens()) {
            try {
                t = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return t.nextToken();
    }

    static int ni() {
        return Integer.parseInt(sn());
    }

    static long nlo() {
        return Long.parseLong(sn());
    }

    public static void main(String args[]) {
        int t = 1;//ni();
        while (t-- > 0) {
            solve();
        }
        out.close();
    }

    static long mod = 998244353;

    static long pro(long a, long b) {
        return (a % mod * b % mod) % mod;
    }

    static long add(long a, long b) {
        return (a + b) % mod;
    }

    static long maxn = 500005;

    static int pow(int n) {
        return (int) (Math.log10(n) / Math.log10(2));
    }

    static void solve() {
        int n = ni();
        int d = ni();
        int k = ni();
        if ((d + 1) > n || k==1)
            out.println("NO");
        else {
            int can[] = new int[n + 1];
            int deg[] = new int[n + 1];
            int dep[] = new int[n + 1];
            List<Long> list = new ArrayList<>();
            for (int i = 1; i <= d; i++) {
                long t = i * maxn + (i + 1);
                list.add(t);
                deg[i]++;
                deg[i + 1]++;
                dep[i + 1] = dep[i] + 1;
                can[i + 1] = Math.min(dep[i + 1], (d - dep[i + 1]));
            }
            int j = d + 2;
            Queue<Integer> q = new LinkedList<>();
            for (int i = 2; i <= d; i++) {
                if (can[i] > 0 && deg[i] < k)
                    q.add(i);
            }
            while (!q.isEmpty() && j < n + 1) {
                int t = q.poll();
                if (can[t] == 0 || deg[t] >= k) continue;
                while (deg[t] < k && j < n + 1) {
                    long nxt = t * maxn + j;
                    list.add(nxt);
                    deg[t]++;
                    deg[j]++;
                    can[j] = can[t] - 1;
                    q.add(j);
                    j += 1;
                }
            }
            if (j < n + 1)
                out.println("NO");
            else {
                out.println("YES");
                for (long h : list) {
                    out.println((h / maxn) + " " + (h % maxn));
                }
            }
        }
    }
}