n
andk
, you need to construct a list which containsn
different positive integers ranging from1
ton
and obeys the following requirement:
Suppose this list is [a1, a2, a3, ... , an], then the list [|a1- a2|, |a2- a3|, |a3- a4|, ... , |an-1- an|] has exactlyk
distinct integers.n
andk
are in the range 1 <= k < n <= 10^4.