#6341. [SCCPC 2021] K-skip Permutation

    ID: 6341 传统题 1000ms 256MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>P14127四川2021Special Judge构造省赛/邀请赛

[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 i

Given two integers nn and kk, your task is to find a permutation PP of nn such that f(P,k)f(P, k) is maximized.

Recall that in a permutation of nn, each integer from 11 to nn (both inclusive) appears exactly once.

输入格式

There is only one test case in each test file.

The first and only line contains two integers nn and kk (1≤n,k≤1061 \le n, k \le 10^6).

输出格式

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

提示

(暂无提示) 标签: P14127|四川|2021|Special Judge|构造|省赛/邀请赛

来源

P14127|[SCCPC 2021] K-skip Permutation