EPS/2024/03/04-03-24/b.py

19 lines
355 B
Python
Raw Permalink Normal View History

2024-03-04 16:25:39 +01:00
def pair(n):
if n%2 == 0:
return "No"
l = (3/2)*(n+1)
res = []
for i in range(1, (n+1)//2):
res.append((i, l+i-1))
for i in range(1, (n+1)//2+n%2):
res.append((n-i+1, l-i))
return "Yes\n"+"\n".join([f"{int(a[0])} {int(a[1])}" for a in res])
for _ in range(int(input())):
print(pair(int(input())))