codeforces 268 (d is not AC)