FGFS - Editorial

https://www.codechef.com/viewsolution/11861897

https://www.codechef.com/viewsolution/11861658

Can someone please point the errors

https://www.codechef.com/viewsolution/14299209

What’s wrong with the approach? Please help

I am getting TLE. Can someone please find the reason.

Thanks a lot for giving your time.

Here is my code.