def solv():
x = int(input())
res=[]
while x>1:
if x%2==1:
res.append(2)
else:
res.append(1)
x=(x+1)//2
print(len(res)+1)
for i in range(1,len(res)+1):
print(res[-i],i)
print(1,len(res)+1)
for _ in range(int(input())):
solv()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 10/10 | ||||||
1 | Accepted | 17ms | 11116 KiB | ||||
subtask2 | 10/10 | ||||||
1 | Accepted | 17ms | 11632 KiB | ||||
subtask3 | 10/10 | ||||||
1 | Accepted | 37ms | 11488 KiB | ||||
subtask4 | 10/10 | ||||||
1 | Accepted | 41ms | 11840 KiB | ||||
subtask5 | 10/10 | ||||||
1 | Accepted | 46ms | 12072 KiB | ||||
subtask6 | 10/10 | ||||||
1 | Accepted | 57ms | 12260 KiB | ||||
subtask7 | 10/10 | ||||||
1 | Accepted | 70ms | 12480 KiB | ||||
subtask8 | 10/10 | ||||||
1 | Accepted | 94ms | 12520 KiB | ||||
subtask9 | 20/20 | ||||||
1 | Accepted | 92ms | 12516 KiB | ||||
2 | Accepted | 93ms | 12764 KiB |