Here is the problem
http://www.codechef.com/MDSW2015/problems/IDCLOVE
and here is my solution http://www.codechef.com/viewsolution/6147834
I got a correct answer for this one but I want to ask if there is another way of solving this kind of problem. If there is an editorial for this problem, can you send me the link? Thanks