Codeforces 305D: Wrong Answer