import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class template {
	public static void main(String[] args) throws IOException {
		FastReader scan = new FastReader();
		//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("fpot.out")));
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		Task solver = new Task();
		//int t = scan.nextInt();
		int t = 1;
		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
		out.close();
	}
	static class Task {
		public void solve(int testNumber, FastReader sc, PrintWriter pw) {
			int t = sc.nextInt();
			int d = sc.nextInt();
			int v = sc.nextInt();
			int[] ly = new int[(d+1)/2+1];
			ly[0]=1;
			ly[1]=v;
			t-=v+1;
			for(int i=2;i<(d+1)/2+1;i++){
				if(t>ly[i-1]*v-1) {
					t -= ly[i - 1] * v - 1;
					ly[i] = ly[i - 1] * v - 1;
				}
				else{
					ly[i]=t;
					t-=t;
				}
			}
			int[][] arr= new int[(d+1)/2+1][];
			if(t>0){
				pw.println("NO");
				return;
			}

			else{
				pw.println("YES");
				int ctr = 1;
				for(int i=0;i<ly.length;i++){
					arr[i]=new int[ly[i]];
					for(int j=0;j<ly[i];j++){
						arr[i][j]=ctr++;
					}
				}
			}
			//pw.println(Arrays.deepToString(arr));
			for(int i=1;i<arr.length;i++){
				if(i==1){
					for(int j=0;j<arr[1].length;j++)
					pw.println(1+" "+arr[i][j]);
				}
				else{
					for(int j=0;j<arr[i].length;j++)
						pw.println(arr[i-1][j/(v-1)]+" "+arr[i][j]);
				}
			}
		}
	}
	static void shuffle(int[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static void shuffle(long[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}
	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

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

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

}