Here is my submission to the problem:
https://www.codechef.com/viewsolution/58627626
I tried to optimize my code as much as possible but still got a TLE in subtask 2.
Here is my submission to the problem:
https://www.codechef.com/viewsolution/58627626
I tried to optimize my code as much as possible but still got a TLE in subtask 2.