Hello guys, i am not able to understand the logic behind flashmt's solution of [problem:478] red-green towers from round 273 . Link to problem :http://codeforces.me/contest/478/problem/D Link to solution :http://codeforces.me/contest/478/standings/page/1# . His solution seems to be quite elegant . If you know some similar problems , please tell me . Thanks in advance .