Codeforces Round 175 (Div. 2)
A
Slightly Decreasing Permutations
Codeforces
1100
原题
←B →
翻译中…

Permutation $*p*$ is an ordered set of integers $*p*_{1},  *p*_{2},  ...,  *p*_{*n*}$, consisting of $*n*$ distinct positive integers, each of them doesn't exceed $*n*$. We'll denote the $*i*$-th element of permutation $*p*$ as $*p*_{*i*}$. We'll call number $*n*$ the size or the length of permutation $*p*_{1},  *p*_{2},  ...,  *p*_{*n*}$.

翻译中…

The decreasing coefficient of permutation $*p*_{1}, *p*_{2}, ..., *p*_{*n*}$ is the number of such $*i* (1 ≤ *i* < *n*)$, that $*p*_{*i*} > *p*_{*i* + 1}$.

翻译中…

You have numbers $*n*$ and $*k*$. Your task is to print the permutation of length $*n*$ with decreasing coefficient $*k*$.

翻译中…

Input

翻译中…

The single line contains two space-separated integers: $*n*, *k* (1 ≤ *n* ≤ 10^{5}, 0 ≤ *k* < *n*)$ — the permutation length and the decreasing coefficient.

翻译中…

Output

翻译中…

In a single line print $*n*$ space-separated integers: $*p*_{1}, *p*_{2}, ..., *p*_{*n*}$ — the permutation of length $*n*$ with decreasing coefficient $*k*$.

翻译中…

If there are several permutations that meet this condition, print any of them. It is guaranteed that the permutation with the sought parameters exists.

翻译中…

样例

Input #1
5 2
Output #1
1 5 2 4 3
InputCopy OutputCopy
Input #2
3 0
Output #2
1 2 3
InputCopy OutputCopy
Input #3
3 2
Output #3
3 2 1
InputCopy OutputCopy
题目信息
题号
285A
时间限制
2 s
内存限制
256 MB
标签
贪心
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。