Run Error in K-Append

https://ide.codingblocks.com/s/178204 This is my code. It works fine for some test cases but is showing run error for some. What should I change?