3 line easy soln

first we will print k-1 pairs then print remaining odd/even numbers similar to kth number then remaining odd/even number.
lets n=10 and k=4 so it will print
1 2 3 4 6 8 10 5 7 9
and if n=10 and k=3 then it will print
1 2 3 5 7 9 4 6 8 10
so we don’t need to keep any update, just print similar to kth number.