Code
T = int(input())
for _ in range(T):
N = int(input())
ans = list()
if N%2==0:
for i in range(0,N,2):
ans.append(i+2)
ans.append(i+1)
else:
for i in range(0,N-3,2):
ans.append(i+2)
ans.append(i+1)
ans.append(N-1)
ans.append(N)
ans.append(N-2)
print(*ans)
Information
- Submit By
- Type
- Submission
- Problem
- P1210 A. Smallest Permutation
- Contest
- Educational Round 1
- Language
- PyPy 3 (Python 3.9.18 PyPy 7.3.15)
- Submit At
- 2025-07-14 15:34:04
- Judged At
- 2025-07-14 15:34:04
- Judged By
- Score
- 100
- Total Time
- 48ms
- Peak Memory
- 18.465 MiB