n,d,k=[int(x) for x in raw_input().split()]
p=1
a=1
k1=k
l=1
while(k1>0 and l<=d/2):
   p=p*k1
   a=a+p
   k1=k1-1
   l=l+1

   
if(d%2):
    if(k1>0): a=a+k1
if(a<n):
    print("NO")

else:    
    l=[]
    f=2
    i=0
    print("YES")
    l.append(1)
    l.append(-1)
    while f<=n :
        j=l[i]
        if(j==-1):
            l.append(-1)
            k=k-1
            i=i+1
            continue
        c=0
        while(c<k and f<=n):
            print j,f
            l.append(f)
            f=f+1
            c=c+1
        i=i+1    
    
