You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Construct any permutation A of N integers such that the value LCM(1+A1
, 2+A2
,…,N+AN
) is minimized.
A permutation of N integers contains all integers from 1 to N exactly once.
Input Format
First line will contain T, number of test cases. Then the test cases follow.
Each test case contains a single line of input, one integer N.
Output Format
For each test case, output a permutation that minimizes the value LCM(1+A1
, 2+A2
,…,N+AN
).
You are given an integer N.
Construct any permutation A of N integers such that the value LCM(1+A1
, 2+A2
,…,N+AN
) is minimized.
A permutation of N integers contains all integers from 1 to N exactly once.
Input Format
First line will contain T, number of test cases. Then the test cases follow.
Each test case contains a single line of input, one integer N.
Output Format
For each test case, output a permutation that minimizes the value LCM(1+A1
, 2+A2
,…,N+AN
).
Constraints
1≤T≤1000
2≤N≤1000
Sample 1:
Input
1
2
Output
2 1
The text was updated successfully, but these errors were encountered: