Codeforces Round 209 (Div. 2)
B
Permutation
Codeforces
1400
原题
← AC →
翻译中…

A permutation $*p*$ is an ordered group of numbers $*p*_{1},   *p*_{2},   ...,   *p*_{*n*}$, consisting of $*n*$ distinct positive integers, each is no more than $*n*$. We'll define number $*n*$ as the length of permutation $*p*_{1},   *p*_{2},   ...,   *p*_{*n*}$.

翻译中…

Simon has a positive integer $*n*$ and a non-negative integer $*k*$, such that $2*k* ≤ *n*$. Help him find permutation $*a*$ of length $2*n*$, such that it meets this equation: image.

翻译中…

Input

翻译中…

The first line contains two integers $*n*$ and $*k*$ ($1 ≤ *n* ≤ 50000$, $0 ≤ 2*k* ≤ *n*$).

翻译中…

Output

翻译中…

Print $2*n*$ integers $*a*_{1}, *a*_{2}, ..., *a*_{2*n*}$ — the required permutation $*a*$. It is guaranteed that the solution exists. If there are multiple solutions, you can print any of them.

翻译中…

Note

翻译中…

Record $|*x*|$ represents the absolute value of number $*x*$.

翻译中…

In the first sample $|1 - 2| - |1 - 2| = 0$.

翻译中…

In the second sample $|3 - 2| + |1 - 4| - |3 - 2 + 1 - 4| = 1 + 3 - 2 = 2$.

翻译中…

In the third sample $|2 - 7| + |4 - 6| + |1 - 3| + |5 - 8| - |2 - 7 + 4 - 6 + 1 - 3 + 5 - 8| = 12 - 12 = 0$.

翻译中…

样例

Input #1
1 0
Output #1
1 2
InputCopy OutputCopy
Input #2
2 1
Output #2
3 2 1 4
InputCopy OutputCopy
Input #3
4 0
Output #3
2 7 4 6 1 3 5 8
InputCopy OutputCopy
题目信息
题号
359B
时间限制
1 s
内存限制
256 MB
标签
构造
动态规划
数学

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