#6341. [SCCPC 2021] K-skip Permutation
[SCCPC 2021] K-skip Permutation
[SCCPC 2021] K-skip Permutation
题目描述
For a permutation $P = p_1, p_2, \cdots, p_n$ of $n$, let $f(P, k)$ be the number of $i$ satisfying $1 \le iGiven two integers and , your task is to find a permutation of such that is maximized.
Recall that in a permutation of , each integer from to (both inclusive) appears exactly once.
输入格式
There is only one test case in each test file.The first and only line contains two integers and ().
输出格式
Output one line containing $n$ integers indicating a permutation $P$ of $n$ that maximizes $f(P, k)$. If there are multiple valid answers you can output any of them.Please, DO NOT output extra spaces at the end of the line, or your answer may be considered incorrect!
3 1
1 2 3
7 3
2 5 1 4 7 3 6
3 7
1 3 2