Code
for _ in range(int(input())):
n=int(input())
if n%2==0:
l=[x-(-1)**x for x in range(1,n+1)]
print(*l)
elif n%2==1 and n!=1:
r=n-1
l=[x-(-1)**x for x in range(1,r+1)]
e=l[-1]
l[-1]=n
l.append(e)
print(*l)
else:
print(1)
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:54:10
- Judged At
- 2025-07-14 15:54:10
- Judged By
- Score
- 100
- Total Time
- 47ms
- Peak Memory
- 18.242 MiB