[Solution] Divisible by i CodeChef Solution | CodeChef Problem Solution 2022
You are given an integer .
Construct a permutation of length such that
- For all , divides .
Recall that a permutation of length is an array where every integer from to occurs exactly once.
It can be proven that for the given constraints at least one such always exists.
Input Format
- The first line of input contains a single integer , denoting the number of test cases. The
Solution Click Below:- CLICK HERE
- description of test cases follow.
- The only line of each test case contains an integer - the length of the array to be constructed.
Output Format
For each test case, output a single line containing space-separated integers , denoting the elements of the array .
If there exist multiple such arrays, print any.
Constraints
- The sum of over all test cases does not exceed
No comments:
Post a Comment