Why is this showing WA(wrong answer)?

https://www.codechef.com/viewsolution/32699790
Dinasour problem
Pls help

try this small testcase n=3, k=2. Your code outputs 3 2 1 and that order makes the number of passes equal to 0, not 2.

oh okay thanks alot