P7852 "EZEC-9" Yet Another Easy Problem

Description

Given $n, m$, you need to output a permutation of length $n$ such that, among all permutations that can be obtained from it using at most $m$ operations, the minimum lexicographic order is as large as possible. One operation is defined as swapping two numbers in the permutation. If there are multiple permutations that satisfy the requirement, you may output any one of them.

Input Format

**This problem has multiple test cases**. The first line contains a positive integer $T$, denoting the number of test cases. For each test case, one line contains $2$ integers $n, m$.

Output Format

For each test case: Output one line with $n$ positive integers, representing the permutation you construct.

Explanation/Hint

[Sample $1$ Explanation] The operation sequence that makes the lexicographic order smallest is: $4\ 3\ 1\ 2\to1\ 3\ 4\ 2\to1\ 2\ 4\ 3$. It can be proven that a smaller lexicographic order cannot be obtained, and that other initial permutations cannot achieve a larger minimum lexicographic order. [Sample $2$ Explanation] Obviously, any permutation can be obtained through operations, so you can output any permutation of length $3$. [Constraints] **This problem uses bundled testdata**. - Subtask 1 (10 points): $m = 0$. - Subtask 2 (10 points): $m \ge n - 1$. - Subtask 3 (25 points): $m = 1$. - Subtask 4 (25 points): $T \le 100$, $n \le 6$. - Subtask 5 (30 points): no special constraints. For $100\%$ of the testdata, $1 \le T \le 10^5$, $1 \le n \le 10^5$, $0 \le m \le n$, $\sum n \le 10^5$. Translated by ChatGPT 5