Codeforces Round 275 (Div. 2)
C
Diverse Permutation
Codeforces
未评级
原题
← BD →
翻译中…

Permutation $*p*$ is an ordered set of integers $*p*_{1},   *p*_{2},   ...,   *p*_{*n*}$, consisting of $*n*$ distinct positive integers not larger than $*n*$. We'll denote as $*n*$ the length of permutation $*p*_{1},   *p*_{2},   ...,   *p*_{*n*}$.

翻译中…

Your task is to find such permutation $*p*$ of length $*n*$, that the group of numbers $|*p*_{1} - *p*_{2}|, |*p*_{2} - *p*_{3}|, ..., |*p*_{*n* - 1} - *p*_{*n*}|$ has exactly $*k*$ distinct elements.

翻译中…

Input

翻译中…

The single line of the input contains two space-separated positive integers $*n*$, $*k*$ ($1 ≤ *k* < *n* ≤ 10^{5}$).

翻译中…

Output

翻译中…

Print $*n*$ integers forming the permutation. If there are multiple answers, print any of them.

翻译中…

Note

翻译中…

By $|*x*|$ we denote the absolute value of number $*x*$.

翻译中…

样例

Input #1
3 2
Output #1
1 3 2
InputCopy OutputCopy
Input #2
3 1
Output #2
1 2 3
InputCopy OutputCopy
Input #3
5 2
Output #3
1 3 2 4 5
InputCopy OutputCopy
题目信息
题号
483C
时间限制
1 s
内存限制
256 MB

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