Codeforces 399C: Wrong Answer