import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.InputMismatchException;

public class Main {
	public static void solve(FastIO io) {
		int N = io.nextInt();
		int D = io.nextInt();
		int K = io.nextInt();

		if (D + 1 > N) {
			io.println("NO");
			return;
		}

		if (K == 1) {
			if (N == 2 && D == 1) {
				io.println("YES");
				io.println("1 2");
			} else {
				io.println("NO");
			}
			return;
		}

		IntFactory fac = new IntFactory(N);
		StringBuilder sb = new StringBuilder();
		int hi = (D + 2) >> 1;
		int lo = (D + 1) >> 1;
		int root = fac.getInt();
		printAns(root, hi - 1, K, fac, sb);
		for (int i = 1; i < K; ++i) {
			printAns(root, lo - 1, K, fac, sb);
		}

		if (fac.done()) {
			io.println("YES");
			io.print(sb.toString());
		} else {
			io.println("NO");
		}
	}

	private static void printAns(int id, int depth, int K, IntFactory fac, StringBuilder sb) {
		if (depth < 0) {
			return;
		}
		for (int i = 1; i < K; ++i) {
			int next = fac.getInt();
			if (next < 0) {
				return;
			}
			sb.append(String.format("%d %d\n", id, next));
			printAns(next, depth - 1, K, fac, sb);
		}
	}

	public static class IntFactory {
		public int curr = 1;
		public int maxInt;

		public IntFactory(int n) {
			maxInt = n;
		}

		public boolean done() {
			return curr > maxInt;
		}

		public int getInt() {
			if (done()) {
				return -1;
			}
			return curr++;
		}
	}

	public static class Node {
		public int id;
		public ArrayList<Node> next = new ArrayList<>();

		public Node(int i) {
			this.id = i;
		}
	}

	public static class NodeFactory {
		public ArrayList<Node> nodes = new ArrayList<>();
		public int maxNodes;
		public int currNode = 1;

		public NodeFactory(int n) {
			maxNodes = n;
		}

		public Node makeNode() {
			if (currNode > maxNodes) {
				return null;
			}
			return new Node(currNode++);
		}
	}

	public static class FastIO {
		private InputStream reader;
		private PrintWriter writer;

		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public FastIO(InputStream r, OutputStream w) {
			reader = r;
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(w)));
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = reader.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			return nextIntArray(n, 0);
		}

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

		public long[] nextLongArray(int n) {
			return nextLongArray(n, 0);
		}

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

		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0) {
					writer.print(' ');
				}
				writer.print(objects[i]);
			}
		}

		public void println(Object... objects) {
			print(objects);
			writer.println();
		}

		public void printArray(int[] arr) {
			for (int i = 0; i < arr.length; i++) {
				if (i != 0) {
					writer.print(' ');
				}
				writer.print(arr[i]);
			}
		}

		public void printArray(long[] arr) {
			for (int i = 0; i < arr.length; i++) {
				if (i != 0) {
					writer.print(' ');
				}
				writer.print(arr[i]);
			}
		}

		public void printlnArray(int[] arr) {
			printArray(arr);
			writer.println();
		}

		public void printlnArray(long[] arr) {
			printArray(arr);
			writer.println();
		}

		public void printf(String format, Object... args) {
			print(String.format(format, args));
		}

		public void flush() {
			writer.flush();
		}
	}

	public static void main(String[] args) {
		FastIO io = new FastIO(System.in, System.out);
		solve(io);
		io.flush();
	}
}