I have tried to submit the solution to the problem which is shown below. I tried a lot but still get idleness limit exceeded.
This is my solution link.
http://mirror.codeforces.com/contest/916/submission/35832727
Can somebody help me how to overcome this??
Thank you in advance.