codeforces; solve "Double Cola" from Yandex Algorithm 2011 Q2