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://mirror.codeforces.com/contest/478/problem/D Link to solution :http://mirror.codeforces.com/contest/478/standings/page/1# . His solution seems to be quite elegant . If you know some similar problems , please tell me . Thanks in advance .