Playing with cards stack

two of the test case is giving wrong answer

@avinashmallik2017 for input
5 2
3 4 7 6 5
Your code is giving output
34657 but it should be
46357
You are not printing in order b1,b2,…bn,an

i have made some changes still getting wrong answer https://ide.codingblocks.com/s/258786