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