Permutation Shuffle : Getting Wrong Answer

Hi,
Can anyone please check my solution. I am getting wrong answer.
Please suggest a test case where it is failing.
Link to Question:PERMSUFF Problem - CodeChef
Link to solution : CodeChef: Practical coding for everyone