This is the question: MINEAT Problem - CodeChef
This is my solution - CodeChef: Practical coding for everyone
My solution gives correct answer for sample test cases. I know this solution will not get me through Subtask2 but I think it should have cleared Subtask1. Please help.