I am getting correct output, then also "TLE" in problem "MUSICHAIR"

Problem link:-

My solution link:-
https://www.codechef.com/viewsolution/56518935