Coming TLE

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

let me know if you found any mistake.
I think its problem with c#, As i also encounter same problem in prev contest. Please let me know if anyone finds reason.