This is my first contest. Solved one problem easily but I can’t understand why I am getting a Time limit exceeded error in this solution.
Please have a look- https://www.codechef.com/viewsolution/40640166
and it will be helpful if one can share the approach for this problem.
Thanks in advance