Can anyone of you please provide some better explanation of http://codeforces.net/contest/449/problem/D than the explanation given in the editorial (http://codeforces.net/blog/entry/13112). I am new to such stuff so I am not good at grasping the concepts as other smart people are.