I am getting TLE.Can anyone give idea on how to optimize?
@codemaster1994 its not place to ask hints and for solutions you have to create your own optmized solution just we can help you out by the ans that please read it carefully.You can ask or can have solution once the contest is over
Please look at the question limits and decide appropriate time complexity of algorithm needed. You can execute roughly 10^8 instructions in a second so you need to start thinking in the right direction