408428: GYM103117 K K-skip Permutation
Description
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 i < n$$$ and $$$p_i + k = p_{i+1}$$$.
Given two integers $$$n$$$ and $$$k$$$, your task is to find a permutation $$$P$$$ of $$$n$$$ such that $$$f(P, k)$$$ is maximized.
Recall that in a permutation of $$$n$$$, each integer from $$$1$$$ to $$$n$$$ (both inclusive) appears exactly once.
InputThere is only one test case in each test file.
The first and only line contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^6$$$).
OutputOutput 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!
ExamplesInput3 1Output
1 2 3Input
7 3Output
2 5 1 4 7 3 6Input
3 7Output
1 3 2