Felix6326727/beyond-accuracy-code-comprehension huggingface dataset:
import sys
from math import sqrt, ceil

N = int(input())
k = ceil(sqrt(2 * N))
if k * (k - 1) != 2 * N:
    print("No")
    sys.exit()

S = [[] for _ in range(k + 1)]
num = 1
for i in range(1, k):
    for j in range(i + 1, k + 1):
        S[i].append(num)
        S[j].append(num)
        num += 1

print("Yes")
print(k)
for i in range(1, k + 1):
    print(len(S[i]), " ".join(map(str, S[i])))


# Example run
# Input:
19276688
# Output:
No
N = int(input())

if N == 1:
    print('Yes')
    print('1 1')
    print('1 1')
elif N == 2:
    print('Yes')
    print('2 1 2')
    print('2 3 1')
    print('2 2 3')
else:
    print('No')


# Example run
# Input:
3986
# Output:
No
def ans(n):
    global c
    c+=1
    if n==1:
        return 1
    else:
        return ans(n-1)+n


n=int(input())
f=0
c=0

for i in range(1, n):
    c=0
    ch=ans(i)
    if ch==n:
        print("Yes")
        f=1
        break
    if ch > n:
        print("No")
        break


if f:
    print(c+1)
    k=c
    i=j=0
    li=[[-1 for j in range(c)] for i in range(c+1)]
    #print(li)
    for l in range(1, n+1):
        li[i][j]=l
        j+=1
        if j==k:
            j=0
            i+=1
            k-=1

    nowi=1
    i=1
    j=c-1
    k=c
    count=1
    for l in range(1, n+1):
            #print(nowi)
            li[i][j]=l
            i+=1
            count+=1
            if count==k+1:
                count=1
                nowi+=1
                i=nowi
                j-=1
                k-=1

    for i in li:
        print(len(i), end=" ")
        for j in i:
            print(j, end=" ")
        print()


# Example run
# Input:
-241292
# Output:
from math import sqrt
from itertools import combinations
N = int(input())
m = (1+sqrt(1+8*N))/2
if int(m) != m:
    print('No')
else:
    print('Yes')
    m = int(m)
    for c in combinations(range(1, m+1), m - 1):
        print(m - 1, *c)


# Example run
# Input:
5378
# Output:
No
n = int(input())
if n%2==1:
    print("Yes")
    print(n)
    for i in range(1, n+1):
        print(2, i, i%n+1)
else:
    print("No")

# Example run
# Input:
-89451
# Output:
Yes
-89451
n=int(input())
l=[i*(i-1)//2 for i in range(2,450)]
if n in l:
  print('Yes')
  k=l.index(n)+1
  print(k+1)
  x=[[k] for _ in range(k+1)]
  p=1
  for i in range(k):
    for j in range(k-i):
      x[i].append(p+j)
      x[i+j+1].append(p+j)
    p=p+k-i
  for i in x:
    print(*i)
else:
  print('No')

# Example run
# Input:
-2
# Output:
No
n=int(input())
for i in range(1,150):
  if i*(i+1)//2==n:
    D=[[0]*i for l in range(i)]
    stopcnt=i
    cnt=0
    a,b=0,0
    print('Yes')
    print(i+1)
    for j in range(n):
      D[a][j-b]=j+1
      cnt+=1
      if cnt==stopcnt:
        a+=1
        b+=stopcnt-1
        cnt=0
        stopcnt-=1
    for a in range(i):
      for b in range(a,i):
        D[b][a]=D[a][b]
    DD=[]
    for j in range(i):
      DD.append(D[j][j])
    D.append(DD)
    for j in D:
      print(len(j),*j)
    exit()
print('No')

# Example run
# Input:
-8164991
# Output:
No
N = int(input())

for i in range(10 ** 5) :
  if i * (i + 1) // 2 == N :
    print('Yes')
    print(i + 1)
    ret = [[] for _ in range(i + 1)]
    cur = 1
    for j in range(i + 1) :
      for _ in range(i - j) :
        ret[j].append(cur)
        cur += 1
    for j in range(1, i + 1) :
      for k in range(j) :
        ret[j].append(ret[k][i-j])
    for j in range(i + 1) :
      print(i, *ret[j])
    
    break
else :
  print('No')


# Example run
# Input:
-587
# Output:
No
n = int(input())
l, r = 0, 10 ** 4
while r - l > 1:
    m = (l + r) // 2
    if m * (m - 1) // 2 <= n:
        l = m
    else:
        r = m
if l * (l - 1) // 2 != n:
    print('No')
else:
    print('Yes')
    print(l)
    a = [[] for _ in range(l)]
    t = 1
    for i in range(l):
        for j in range(i + 1, l):
            a[i].append(t)
            a[j].append(t)
            t += 1
    for x in a:
        print(len(x), end=' ')
        print(' '.join(map(str, x)))


# Example run
# Input:
-23420607
# Output:
No
# 基本形に追加するのを考える
# [1 2] [2 3] [1 3] の基本形にそれぞれ新しく1つずつ追加するとすると [1 2 4] [2 3 5] [1 3 6] [4 5 6]
# n=10だと
# [1 3 5 7] [1 2 6 8] [2 3 4 9 ] [4 5 6 10] [7 8 9 10]
# これに新しいのを加えるとするとすでにある5つを新規に導入するので 15
# [1 3 5 7 11] [1 2 6 8 12] [2 3 4 9 13] [4 5 6 10 14] [7 8 9 10 15] [11 12 13 14 15]
n = int(input())
if n == 1:
    print("Yes")  # 納得いかんでしょこれ
    exit()
anss = [[1, 2], [2, 3], [1, 3]]
target, length = 3, 3
while target <= 10**5 and target <= n:
    if target == n:
        print("Yes")
        print(length)
        for ans in anss:
            b = " ".join(list(map(str, ans)))
            # print(b)
            print(f"{len(ans)} {b}")
        exit()
    nex = list(range(target + 1, target + length + 1))
    for i, ans in enumerate(anss):
        ans.append(nex[i])
    anss.append(nex)
    target += length
    length += 1
print("No")

# Example run
# Input:
229
# Output:
No
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("YES") if fl else print("NO")
import collections
import math
import itertools
import heapq as hq

n = ni()
#nC2 = n(n-1)//2 <= n  <-> n<=3

if n==1:
    print("Yes")
    print(2)
    print(1,1)
    print(1,1)
elif n==2:
    print("Yes")
    print(2)
    print(2,1,2)
    print(2,1,2)
elif n==3:
    print("Yes")
    print(3)
    print(2,1,2)
    print(2,2,3)
    print(2,3,1)
else:
    print("No")


# Example run
# Input:
5507
# Output:
No
def run(N):
    ret = []
    if N < 3:
        ret.append('No')
    else:
        for i in range(3, N+1):
            if N * 2 < i * (i-1):
                ret.append('No')
            elif N * 2 == i * (i-1):
                ret.append('Yes')
                ret.append(i)
                S = []
                for j in range(1, i+1):
                    '''
                    j列の1行目は、1列目のj行目
                    j列の2行目は、2列目のj行目
                    j列のk行目は、k列目のj行目
                    j列のj行目以降は、j-1列目の最後の行の数+1から1ずつ増加
                    '''
                    tmp = [i-1]
                    for k in range(1, i):
                        if k < j:
                            tmp.append(S[k-1][j-1])
                        else:
                            if j < 2:
                                tmp.append(k-j+1)
                            else:
                                tmp.append(S[j-2][i-1]+k-j+1)
                    S.append(tmp)
                ret.append(S)
    return ret


def main():
    N = int(input())
    ret = run(N)
    print(ret)
    print(ret[0])
    if len(ret) > 1:
        k = ret[1]
        print(k)
        for s in ret[2]:
            s = [str(si) for si in s]
            print(' '.join(s))


if __name__ == '__main__':
    main()


# Example run
# Input:
-2503
# Output:
['No']
No
import itertools
N = int(input())
for k in range(1000):
	if N * 2 == k * (k - 1):
		print("Yes")
		print(k)
		ans = [[] for i in range(k)]
		c = list(itertools.combinations(range(k), 2))
		for i in range(N):
			for j in c[i]:
				ans[j].append(i + 1)
		for i in ans:
			print(k - 1, end = " ")
			for j in i:
				print(j, end = " ")
			print()
		break
else:
	print("No")

# Example run
# Input:
981571
# Output:
No
N = int(input())

ans = 'No'
k = 2
while True:
    kk = k*(k-1)
    if kk > N*2:
        ans = 'No'
        break
    elif kk == N*2:
        ans = 'Yes'
        break
    k += 1

print(ans)
print(k)
if ans == 'Yes':
    top = 1
    for i in range(3):
        print(k-1, end=" ")
        for j in range(k-1):
            val = ((top + j -1) % N) + 1
            print(val, end=" ")
        print('')
        top += k-2

    top = 2
    for i in range(k-3):
        print(k-1, end=" ")
        for j in range(k-1):
            print(top + (k-2)*j, end=" ")
        print('')
        top += 1


# Example run
# Input:
6252
# Output:
No
113
n=int(input())
if n==1:
  print("Yes")
  print(2)
  print(1,1)
  print(1,1)
elif n==2:
  print("Yes")
  print(3)
  print(1,1)
  print(1,2)
  print(2,1,2)
elif n==3:
  print("Yes")
  print(3)
  print(2,1,2)
  print(2,1,3)
  print(2,2,3)
else:
  print("No")

# Example run
# Input:
16247008
# Output:
No
n = int(input())

if n == 1:
    print("Yes")
    print(2)
    print(1,1)
    print(1,1)
elif n == 3:
    print("Yes")
    print(3)
    print(2,1,2)
    print(2,2,3)
    print(2,3,1)
else:
    print("No")



# Example run
# Input:
-58867430
# Output:
No
n = int(input())

k = (1 + (1 + 8 * n)** 0.5) * 0.5
if k.is_integer():
    k = int(k)
    print('Yes')
    print(k)
    num,ans = 1,[[] for _ in range(k)]
    for i in range(k):
        for j in range(i + 1, k):
            ans[i].append(num)
            ans[j].append(num)
            num += 1
        print(k - 1, *ans[i])
else:
    print('No')


# Example run
# Input:
35294
# Output:
No
K = int(input())

def calc_n(K):
  for n in range(1, int(K/2)+2):
    if n*(n+1)/2 == K:
      return n
  return "NO"

N = calc_n(K)
if not isinstance(N, int):
  print(N)
else:
  print(N+1)
  all_num = {i:2 for i in range(1, K+1)}
  remain = K * 2
  #print(all_num)
  pair = []
  for i in range(1, K+1):
    if all_num[i] == 2:
      pair.append(i)
      all_num[i] -= 1
      remain -= 1
      if len(pair) == N:
        break
  print(N, " ".join([str(i) for i in pair]))

  while remain != N:
    pair = []
    for i in range(1, K+1):
      if all_num[i] == 1 and len(pair) == 0:
        pair.append(i)
        all_num[i] -= 1
        remain -= 1
      if all_num[i] == 2 and len(pair) != 0:
        pair.append(i)
        all_num[i] -= 1
        remain -= 1
        if len(pair) == N:
          break
    print(N, " ".join([str(i) for i in pair]))

  pair = []
  for i in range(1, K+1):
    if all_num[i] == 1:
      pair.append(i)
      all_num[i] -= 1
      remain -= 1
      if len(pair) == N:
        break
  print(N, " ".join([str(i) for i in pair]))

# Example run
# Input:
-7
# Output:
NO
def 解():
    iN = int(input())

    #解法pdfを見て作ったその2

    iK = int((2 * iN) ** 0.5)
    if 2 * iN != iK * (iK +1 ) :
        print("No")
    else:
        print("Yes")
        print(iK+1)
        oAns = []
        iStart = 1
        for i in range(iK):
            oRes = [iK]
            oRes.extend(list(range(iStart,iStart+i+1)))
            iLast = oRes[-1]
            for k in range(i+1,iK):
                iLast += k
                oRes.append(iLast)
            oAns.append(" ".join([str(_) for _ in oRes]))
            iStart += i +1
        oRes = [iK]
        iStart = 0
        for i in range(0,iK):
            iStart += i +1
            oRes.append(iStart)
        oAns.append(" ".join([str(_) for _ in oRes]))
        print("\n".join(oAns))
解()


# Example run
# Input:
2147483647
# Output:
No
N=int(input())
k=2
while N>=(k-1)*k/2:
    if N==(k-1)*k/2:
        print("Yes")
        print(k)
        a=list([] for i in range(k))
        t=1
        for i in range(0,k):
            for n in range(1,k-i):
                a[i].append(t)
                a[i+n].append(t)
                t+=1
        for i in range(k):
            print(str(k-1)+" "+" ".join(map(str,a[i])))
        exit()
    else:
        k+=1
print("No")


# Example run
# Input:
42
# Output:
No
from math import sqrt
n = int(input())
a = 1+8*n
b = int(sqrt(a))
if b**2 != a or b%2==0:
    print("No")
    exit()
else:
    k = (1 + b)//2
    s = [[] for i in range(k)]
    cur = 1
    for i in range(k):
        for j in range(k-i-1):
            s[i].append(cur)
            s[i+j+1].append(cur)
            cur += 1
    print("Yes")
    print(k)
    for i in range(k):
        res = "{} ".format(len(s[i])) + " ".join(map(str, s[i]))
        print(res)

# Example run
# Input:
0
# Output:
Yes
1
0
n = int(input())
m = int((n*2)**0.5)
if m*(m+1)!=n*2:
    print('No')
else:
    print('Yes')
    print(m+1)
    ans = [[0]*m for _ in range(m+1)]
    for i in range(m+1):
        for j in range(m):
            if i==0 and j==0:
                ans[i][j] = 1
            elif i==j:
                ans[i][j] = ans[i-1][j-1] + m-i + 1
            else:
                if i>j:
                    if i==j+1:
                        ans[i][j] = ans[i-1][j]
                    else:
                        ans[i][j] = ans[i-1][j] + 1
                else:
                    ans[i][j] = ans[i][j-1] + 1
    for a in ans:
        print(len(a), *a)

# Example run
# Input:
61070189
# Output:
No
N=int(input())
stock=[N-i for i in range(N)]

N*=2
n=-int(-N**0.5//1)
if N/n==N//n:
    yoko=N//n
else:
    print("No")
    exit()

ans=[[0 for j in range(yoko)]for i in range(n)]

for i in range(N-1):
    for j in range(i,yoko):
        temp=stock.pop(-1)
        ans[i][j]=temp
        ans[j+1][i]=temp

print("Yes")
print(len(ans))
for item in ans:
    print(len(item), *item)

# Example run
# Input:
1049999
# Output:
No
n = int(input())

memo = 0
for i in range(1,2*(10**5)):
    if i*(i-1) == 2*n:
        memo = i
        break
    elif i*(i-1) > 2*n:
            break
    
if memo == 0:
    print("No")
    
else:
    print("Yes")
    print(memo)
    spc = 1
    for i in range(memo):
        print(memo-1,"",end="")
        for j in range(1,memo+1):
            if not(spc==j):
                print(j,"",end="")
        spc += 1
        print("")
        
        

# Example run
# Input:
-4
# Output:
No
import math

n = int(input())

flag = False

if n == 1:
    print('Yes')
    print(2)
    print(1, 1)
    print(1, 1)
    

elif n == 2:
    print('Yes')
    print(2)
    print(2, 1, 2)
    print(2, 1, 2)
    

else:
    for i in range(int(math.sqrt(2*n)+1)):
        if i * (i + 1) == 2 * n:
            k = i
            flag = True
            break
    if flag:
        print('Yes')
        print(k + 1)
        lll = []
        mem = 1
        for j in range(k+1):
            s = []
            
            for l in range(k):
                if l >= j:
                    s.append(mem)
                    mem += 1
                else:
                    s.append(lll[l][j-1])

            lll.append(s)
            print(k, ' '.join(map(str, s)))


    else:
        print('No')



# Example run
# Input:
51856
# Output:
No
n=int(input())

k=2
while(2*n > k*(k-1)):
    k+=1

if(2*n!=k*(k-1)):
    print("No")
else:
    print("Yes")
    print(k)
    tmp=0
    result=[[0]*(k-1) for i in range(k)]
    for i in range(k):
        for j in range(i):
            result[i][j]=result[j][i-1]
        for l in range(k-i-1):
            tmp+=1
            result[i][i+l]=tmp
        
    for j in range(k):
        print("{} ".format(k-1),end="")
        for i in range(k-2):
            print("{} ".format(result[j][i]),end="")
        print(result[j][k-2])

# Example run
# Input:
-507621088
# Output:
No
N = int(input())
for k in range(N+2):
    if k * (k-1) == 2 * N:
        S = [[] for _ in range(k+1)]
        n = 1
        for i in range(2, N+1):
            for j in range(1, i):
                S[i].append(n)
                S[j].append(n)
                n += 1
        print(k)
        for i in range(1, k+1):
            ans = [len(S[i])] + S[i]
            print(' '.join(map(str, ans)))
        exit()
print('No')

# Example run
# Input:
-40
# Output:
No
N=int(input())
triangle=[(i*(i-1))//2 for i in range(0,2*N+1)]
if not N in triangle:
    print('No')
else:
    print('Yes')
    k=triangle.index(N)
    print(k)
    count=0
    S=[[] for i in range(0,k)]
    for i in range(0,k):
        if i==0:
            S[i]=[j for j in range(1,k)]
            count=k-1
        else:
            for j in range(0,i):
                S[i].append(S[j][i-1])
            for j in range(0,k-1-i):
                S[i].append(count+1)
                count+=1
        print(k-1,*S[i])


# Example run
# Input:
-58867430
# Output:
No
N = int(input())
if N == 3:
    print("Yes")
    print(3)
    print(2,1,2)
    print(2,3,1)
    print(2,2,3)
elif N == 1:
    print("Yes")
    print(2)
    print(1, 1)
    print(1, 1)
else:
    print("No")

# Example run
# Input:
51856
# Output:
No
def resolve():
    N = int(input())
    
    K = 0
    for i in range(1, 1000):
        if (i*(i-1)//2 == N):
            K = i
            break

    if K == 0:
        print("No")
        return
    else:
        S = [[] for _ in range(K)]
        cnt = 1
        for i in range(K):
            for j in range(i+1, K):
                S[i].append(cnt)
                S[j].append(cnt)
                cnt += 1

    print("Yes")
    print(K)
    for s in S:
        print(len(s), *s)

if __name__ == "__main__":
    resolve()

# Example run
# Input:
30315
# Output:
No
N=int(input())

if N==1:
  print("Yes")
  print(2)
  print(1,1)
  print(1,1)
elif N==3:
  print("Yes")
  print(3)
  print(2,1,2)
  print(2,2,3)
  print(2,3,1)
else:
  print("No")

# Example run
# Input:
-2552
# Output:
No
N = int(input())

n1 = 8*N+1
a = int(n1**0.5)

if N>=3 and n1==a**2:
    n = (-3+a)//2
    if (-3+a)%2:
        print("No")
    else:
        d = [[0]*(n+1) for _ in range(n+2)]
        d[0][0] = 1
        d[0][1] = 2
        d[1][0] = 2
        d[1][1] = 3
        d[2][0] = 3
        d[2][1] = 1
        for i in range(1, n):
            v = 4+((i-1)*(i+4)//2)
            c = 2+i

            for j in range(c):
                d[c][j] = v+j
                d[j][c-1] = v+j

        print("Yes")
        print(n+2)
        for i in range(n+2):
            print(n+1, *d[i], sep=" ")
else:
    print("No")

# Example run
# Input:
1198832728
# Output:
No
N = int(input())

def gen_set(k):
    s = [[0] * k for _ in range(k + 1)]

    for i in range(k + 1):
        if i == 0:
            s[i][0] = 1
            for j in range(1, k):
                s[i][j] = s[i][j - 1] + j    
        elif 1 <= i < k:
            s[i][0] = s[0][i]
            for j in range(1, k):
                if j <= i:
                    # Horizontal
                    s[i][j] = s[i][j - 1] + 1
                else:
                    # Vertical
                    s[i][j] = s[i][j - 1] + j
        else:
            # Diagonal
            s[i][0] = s[0][0]
            for j in range(1, k):
                s[i][j] = s[i][j - 1] + j + 1

    return s


x = 0
k = 0
while x < N:
    k += 1
    x += k

if x == N:
    s = gen_set(k)
    print("Yes")
    print(k + 1)
    for t in s:
        print(k, *t)
else:
    print("No")


# Example run
# Input:
33453305
# Output:
No
N = int(input())
if N == 1:
    print("Yes")
    print(2)
    print(1, 1)
    print(1, 1)
elif N == 2:
    print("No")
else:
    for i in range(N):
        if N == i * (i+1)/2:
            Ans = []
            ans =[1]
            for j in range(i-1):
                ans.append(ans[-1]+j+2)
            Ans.append(ans)
            ini, level = 1, 1
            for j in range(1, i+1):
                ans = [ini + k for k in range(level)]
                step, wide, temp = i-j, level, ini+level-1
                while step > 0:
                    ans.append(temp+wide)
                    temp += wide
                    step -= 1
                    wide += 1
                Ans.append(ans)
                ini += level
                level += 1
            print("Yes")
            print(len(Ans))
            for j in range(len(Ans)):
                print(i, " ".join(map(str, Ans[j])))      
            break
    else:
        print("No")

# Example run
# Input:
-220533202
# Output:
No
def run(N):
    ret = []
    if N == 1:
        ret.append('Yes')
        ret.append(1)
        ret.append([[2, 1, 1]])
    elif N < 3:
        ret.append('No')
    else:
        for i in range(3, N+1):
            if N * 2 < i * (i-1):
                ret.append('No')
                break
            elif N * 2 == i * (i-1):
                ret.append('Yes')
                ret.append(i)
                S = []
                for j in range(1, i+1):
                    '''
                    j列の1行目は、1列目のj行目
                    j列の2行目は、2列目のj行目
                    j列のk行目は、k列目のj行目
                    j列のj行目以降は、j-1列目の最後の行の数+1から1ずつ増加
                    '''
                    tmp = [i-1]
                    for k in range(1, i):
                        if k < j:
                            tmp.append(S[k-1][j-1])
                        else:
                            if j < 2:
                                tmp.append(k-j+1)
                            else:
                                tmp.append(S[j-2][i-1]+k-j+1)
                    S.append(tmp)
                ret.append(S)
    return ret


def main():
    N = int(input())
    ret = run(N)
    print(ret[0])
    if len(ret) > 1:
        k = ret[1]
        print(k)
        for s in ret[2]:
            s = [str(si) for si in s]
            print(' '.join(s))


if __name__ == '__main__':
    main()


# Example run
# Input:
14508349
# Output:
No
import math
n = int(input())
if n == 1:
    print("Yes")
    print(1)
    print("2 1 1")
    exit()

ok = False
for i in range(2, int(math.sqrt(n*2)+1)):
    if n*2 % i == 0 and n*2 // i == i+1:
        ok = True
        size = i
        break
if ok:
    ans = [[0] * size for _ in range(size+1)]
    val = 1
    for i in range(0, size+1):
        for j in range(i, size):
            ans[i][j] = val
            val += 1
    val = 1
    for i in range(0, size):
        for j in range(i, size):
            ans[1+j][i] = val
            val += 1
    print("Yes")
    print(size+1)
    for line in ans:
        print(str(size) + " " + " ".join([str(item) for item in line]))

else:
    print("No")

# Example run
# Input:
629110165
# Output:
No
N = int(input())

if N == 1:
  print('yes')
  print(1, 1)
  print(1, 1)
elif N == 3:
  print('yes')
  print(3, 1, 2)
  print(3, 2, 3)
  print(3, 3, 1)
else:
  print('no')

# Example run
# Input:
-1
# Output:
no
N = int(input())
Ss = [[1], [1]]
while True:
    k = len(Ss)
    m = k * (k - 1) // 2
    if N < m:
        print("No")
        break
    elif N == m:
        print("Yes")
        print(k)
        for S in Ss:
            print(len(S), " ".join(map(str, S)))
        break
    S_new = []
    for i in range(k):
        x = m + 1 + i
        Ss[i].append(x)
        S_new.append(x)
    Ss.append(S_new)

# Example run
# Input:
-1151131
# Output:
No
from collections import deque
N = int(input())
used1 = [0] * N
used2 = [0] * N

ans_list = [0] * 500
for i in range(1, 500):
  ans_list[i] = int(i * (i + 1) // 2)

if N in ans_list:
  print("Yes")
  k = ans_list.index(N)
  print(k + 1)
  A = [deque([]) for i in range(k)]
  for i in range(1, N + 1):#最大10 ** 5
    p = int(((1 + 8 * i) ** (1/ 2) - 1.001) // 2)
    A[p].append(i)
  #print(A)
  #print(A[1][0])
  for i in range(k):
    print(k, end = " ")
    for j in range(i + 1):
      #print("j", j)
      print(A[i][j], end = " ")
    for l in range(i + 1, k):
      print(A[l][i], end = " ")
    print("")
  
  print(k, end = " ")
  for i in range(k):
    print(A[i][i], end = " ")
  print("")
else:
  print("No")

# Example run
# Input:
1
# Output:
Yes
2
1 1 
1 1
def search(n):
    for i in range(1, n+1):
        if i*(i-1) == 2*n:
            return i
    return 0


n = int(input())

nodes = search(n)
if nodes != 0:
    print("Yes")
    out = [[] for i in range(nodes)]
    index = [int(i) for i in range(nodes)]
    counter = 1
    for i in range(len(index)):
        for j in range(index[i]):
            out[j].append(counter)
            out[i].append(counter)
            counter += 1
    for i in range(len(out)):
        str1 = str(out[i])
        table = str1.maketrans({
            ',': '',
            '[': '',
            ']': '',
        })
        str1 = str1.translate(table)
        print(("{} {}".format(len(out[i]), str1)))
else:
    print("No")

# Example run
# Input:
9186
# Output:
No