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.
输入描述:
The single line of the input contains two space-separated positive integers n, k (1 ≤ k n ≤ 105).
输出描述:
Print n integers forming the permutation. If there are multiple answers, print any of them.
备注:
By x we denote the absolute value of number x.
加载中...