codeforces; solve "Next Round" from VK Cup 2012 Qualification Round 1