http://www.codechef.com/viewsolution/5788263
^link of problem summary
You are not allowed to ask for hints here.
Check the question constraints and subtask 2. Make up some handwritten test cases and verify your output.
You are not allowed to ask for hints here.
Check the question constraints and subtask 2. Make up some handwritten test cases and verify your output.