SHUFFLE PARTIALLY ACCEPTED PLEASE HELP!

Solution

Instead of going upto only k numbers you should move upto n numbers. And there is no need of reverse checking your array your aim is to make sequence sorted in ascending order. Also you should maintain visited array for less computation as work for i+k,i+2k,i+3k is already done. Rest everything is fine. Check my code : -
https://www.codechef.com/viewsolution/32261341