Why am I getting TLE my solution is atmost 10^8

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