anyone who solved this problem http://mirror.codeforces.com/problemset/problem/12/D , can please share his ideas.
i have read this blog http://mirror.codeforces.com/blog/entry/44775#comment-437643 , the explanation which is written by
@satyaki3794 , how will it fit in time limit ?