QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 256 MB Puntuación total: 100

#18332. Six Walnuts

Estadísticas

Xiaohetao is organizing a premium walnut gift box. He arranges walnuts numbered $1 \sim n$ in a row, with corresponding positions also numbered $1 \sim n$. The final arrangement forms a permutation $p$ of $1 \sim n$, where $p_i$ represents the walnut number placed at the $i$-th position.

To measure the aesthetic value of the gift box, Xiaohetao defines the value score of a single walnut as: $$\min(|p_i - i|, m)$$ where $p_i$ represents the number of the walnut at the $i$-th position, and $m$ is a given constant.

That is, the score is the minimum of the distance between the walnut's actual position and its number, and the constant $m$. Xiaohetao wishes to maximize the total value score of all walnuts. Please construct any one permutation $p$ that satisfies this condition.

Input

A single line containing two integers $n$ and $m$, where $1 \le n \le 1000000$ and $1 \le m \le n$.

Output

Output a single line of integers representing the permutation you constructed.

Examples

Input 1

5 2

Output 1

3 4 5 1 2

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.